Re: verilog like class w/ bitslicing int/long classtype

2009-01-31 Thread Marc 'BlackJack' Rintsch
On Fri, 30 Jan 2009 21:59:34 +0100, Stef Mientki wrote: Marc 'BlackJack' Rintsch wrote: On Fri, 30 Jan 2009 00:25:03 +0100, Stef Mientki wrote: try this: class MyRegClass ( int ) : def __init__ ( self, value ) : self.Value = value def __repr__ ( self ) : line = hex (

Re: verilog like class w/ bitslicing int/long classtype

2009-01-30 Thread Stef Mientki
Marc 'BlackJack' Rintsch wrote: On Fri, 30 Jan 2009 00:25:03 +0100, Stef Mientki wrote: try this: class MyRegClass ( int ) : def __init__ ( self, value ) : self.Value = value def __repr__ ( self ) : line = hex ( self.Value ) line = line [:2] + line [2:].upper() return

Re: verilog like class w/ bitslicing int/long classtype

2009-01-30 Thread rdmurray
Quoth Stef Mientki stef.mien...@gmail.com: Marc 'BlackJack' Rintsch wrote: On Fri, 30 Jan 2009 00:25:03 +0100, Stef Mientki wrote: try this: class MyRegClass ( int ) : def __init__ ( self, value ) : self.Value = value def __repr__ ( self ) : line = hex (

verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread mark . seagoe
I'm trying to make a script environment with datatypes (or classes) for accessing hardware registers. At the top level, I would like the ability to bitwise ops if bit slice brackets are used, but if no brackets are used, I would like it to write/read the whole value. For example, if I have

Re: verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread Stef Mientki
mark.sea...@gmail.com wrote: I'm trying to make a script environment with datatypes (or classes) for accessing hardware registers. At the top level, I would like the ability to bitwise ops if bit slice brackets are used, but if no brackets are used, I would like it to write/read the whole

Re: verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread John Machin
On Jan 30, 9:02 am, mark.sea...@gmail.com wrote: I'm trying to make a script environment with datatypes (or classes) for accessing hardware registers.  At the top level, I would like the ability to bitwise ops if bit slice brackets are used, but if no brackets are used, I would like it to

Re: verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread John Machin
On Jan 30, 9:55 am, Stef Mientki stef.mien...@gmail.com wrote:   def __repr__ ( self ) :     line = hex ( self.Value )     line = line [:2] + line [2:].upper()     return line btw, I'm a hardware guy too, and therefor I've never understood why the hex function returns lowercase ;-) 0xFF??

Re: verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread mark . seagoe
Thanks. So far these solutions will return strings. So I can't really treat it like a variable, yet still perform bitslice on it, since I need a special class to do bitslice and bit selection, but as soon as I try to pass it into some other function to check a bit, I gotta then do another

Re: verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread Stef Mientki
mark.sea...@gmail.com wrote: Thanks. So far these solutions will return strings. So I can't really treat it like a variable, yet still perform bitslice on it, since I need a special class to do bitslice and bit selection, but as soon as I try to pass it into some other function to check a bit,

Re: verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread Stef Mientki
mark.sea...@gmail.com wrote: Thanks. So far these solutions will return strings. So I can't really treat it like a variable, yet still perform bitslice on it, since I need a special class to do bitslice and bit selection, but as soon as I try to pass it into some other function to check a bit,

Re: verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread mark . seagoe
On Jan 29, 3:13 pm, Stef Mientki stef.mien...@gmail.com wrote: mark.sea...@gmail.com wrote: Thanks.  So far these solutions will return strings.  So I can't really treat it like a variable, yet still perform bitslice on it, since I need a special class to do bitslice and bit selection, but

Re: verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread MRAB
John Machin wrote: On Jan 30, 9:02 am, mark.sea...@gmail.com wrote: I'm trying to make a script environment with datatypes (or classes) for accessing hardware registers. At the top level, I would like the ability to bitwise ops if bit slice brackets are used, but if no brackets are used, I

Re: verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread Jervis Whitley
On Fri, Jan 30, 2009 at 9:02 AM, mark.sea...@gmail.com wrote: I'm trying to make a script environment with datatypes (or classes) for accessing hardware registers. At the top level, I would like the ability to bitwise ops if bit slice brackets are used, but if no brackets are used, I would

Re: verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread mark . seagoe
On Jan 29, 3:13 pm, Stef Mientki stef.mien...@gmail.com wrote: mark.sea...@gmail.com wrote: Thanks.  So far these solutions will return strings.  So I can't really treat it like a variable, yet still perform bitslice on it, since I need a special class to do bitslice and bit selection, but

Re: verilog like class w/ bitslicing int/long classtype

2009-01-29 Thread Marc 'BlackJack' Rintsch
On Fri, 30 Jan 2009 00:25:03 +0100, Stef Mientki wrote: try this: class MyRegClass ( int ) : def __init__ ( self, value ) : self.Value = value def __repr__ ( self ) : line = hex ( self.Value ) line = line [:2] + line [2:].upper() return line def __repr__(self):