Re: [myhdl-list] MEP 107 assessment
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2012-06-07 09:43:22
|
On 06/06/2012 08:49 PM, Oscar Diaz wrote: > Just to be sure, what are you meaning with dynamic indexing? An index which is not a constant. > My first > thought was this is when the index is a mutable object, or that it can > change on runtime. For that case conversion is done with RAM > inference, and only for lists. Some confusion here. Ram inference is done after converson, by a synthesis tool that recognizes a certain pattern. Also, mutability is a characteristic of python objects. "Constantness" depends on how objects are used in code. > However, I also thought of, what if the > index is an immutable, and can be treated as a constant at runtime? Should work today. > I understand that, in RAM (and also ROM) inference, the index must be a > Signal, and fails for any other type. Should work with a plain intbv variable also. > If this MEP covers index lookup, > that other immutable types could be treated as the selection of a > signal in a container. Indexing with a constant should work today also. What is not supported currently is "heterogenuous" lists (lists in which not all member have identical bit widths), and this is what the MEP proposes. But I don't see how for the general case, because the target HDLs are not so dynamic as Python. > Or, maybe it's matter of coding style? What approach is more > "pythonic" or more convenient for conversion? IMHO, in design both > approaches (attribute and dict index) are equally valid. I guess this > could be a matter of debate in the list. Attributes are normally the first choice to define the names of instance variables. -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as a HDL: http://www.myhdl.org VHDL development, the modern way: http://www.sigasi.com World-class digital design: http://www.easics.com |