verilog like class w/ bitslicing & int/long classtype

mark.seagoe at gmail.com mark.seagoe at gmail.com
Thu Jan 29 19:44:45 EST 2009


On Jan 29, 3:13 pm, Stef Mientki <stef.mien... at gmail.com> wrote:
> mark.sea... at 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, 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.
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
> there are a few vhdl projects,
> can't find my links right now
> - myhdl
> - something like pysystemC
>
> maybe you can find the answer there
>
> cheers,
> Stef- Hide quoted text -
>
> - Show quoted text -

Thanks for the tip.  I checked out myhdl and it has a class called
intbv which does exactly this, and much more than I need.  It's GNU
lesser license though, so not sure how to handle that, if I just want
some concepts of the code as examples, but don't want copy it per se.

Thanks,
Mark



More information about the Python-list mailing list