Re: [myhdl-list] Bit-wise inversion issue
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2008-02-28 21:32:15
|
Tom Dillon wrote: > I don't think the sliced result gets ._nrbits .min or .max set. > > I think it should, at least for clarification. Actually a slice returns a new intbv with _nrbits, min and max set. (this is the idiomatic way to create an "unsigned", hardware-oriented intbv). But it is the only operator that does this. All others currently return unsized intbv's or even int's. This is usually not an issue, because the idiomiatic MyHDL usage for updates is: for intbv's: a[m:n] = <expression> in particular, to set a new value: a[:] = <expression> and for signals: s.next = <expression> Therefore, I don't need to look at the right-hand expression to derive a bit width. In this way, all issues with this as in VHDL and especially Verilog are simply avoided. And of course I can optimize a little (and keep it simple) by not worrying about setting bit widths on operator results. Last but not least, I don't think that conversion to VHDL or Verilog would otherwise be feasible. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |