[myhdl-list] MEP 107 assessment
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2012-06-05 20:52:48
|
I have read and thought about MEP 107. Here is my initial assessment. This MEP is strictly about conversion. This is explained in the first paragraph, but I think it should be mentioned in the title also, because this has proven to be an eternal source of confusion. It should be made clear that all modeling aspects being discussed are supported by MyHDL as it is today. One aspect of conversion is that it is unavoidable to consider the capabilities and restrictions of the conversion targets VHDL and Verilog, with special attention to synthesis. I think that aspect is taken into account insufficiently. Basically, the MEP proposes conversion support for various types of Signal object lookup. The example given is: myObject.x.next = ListOfSignal[10] + DictOfSignal['fred'] and the proposed conversion is: myObject_x = ListOfSignal_10 + DictOfSignal_fred Conceptually, these 3 cases are very similar: lookup based on a manifest attribute name, index, string. The immediate question is why we would need support for 3 almost identical cases. The answer is that this example is not representative for the main purpose of a List or a Dict data structure. The essence of a List or a Dict is lookup based on a *variable* index (integer or string). But this can only be supported by a mapping to an equivalent data structure in the target. Note that MyHDL conversion supports this today for "homogenuous" lists. However, I don't know how this would work for a "heterogenuous" list or for a dictionary. There may be solutions based on pointers, access types, or SystemVerilog data structures, but I doubt all this is worth the trouble, especially because there is little chance that such beasts would be supported by synthesis. Synthesis is not the only, but an important application of the converted code. Of course conversion could be restricted to the case of manifest indices. But that is a bad solution for the following reasons: 1) when support for heterogenuous lists or dictionaries is advertized, it is unavoidable that people will expect this to work with variable indices. So it raises expectations that cannot be met and will only result in frustrations. 2) there is a superior alternative available, which is attribute lookup. Better direct people to that solution immediately. -- 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 |