verilog like class w/ bitslicing & int/long classtype

mark.seagoe at gmail.com mark.seagoe at gmail.com
Thu Jan 29 18:09:31 EST 2009


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 operation to convert back to a variable.

So I can get it to a point where I can do shadow_register[3] and get
the value of any bit, or I can do shadow_register[4:2] and get a
bitslice, and I can write them just as easily at this point.  If I add
the __new__ method into the class, the instance obj becomes int, but
is no longer slicable.  I think it looks like I can't have it both
ways.



More information about the Python-list mailing list