Re: [myhdl-list] MEP 107 assessment
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2012-06-08 21:24:34
|
On 06/07/2012 09:11 PM, Christopher Felton wrote: > On 6/5/2012 3:52 PM, Jan Decaluwe wrote: >> 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. > > All aspects being discussed are almost supported for modeling today. It > has been reported that the @always_comb decorator fails to extract the > sensitivity list if a signal is buried in a structure. I have 4 > examples below that demonstrate the issue (a control and 3 fails). > There is the limitation that the structures cannot be used on the right > hand side currently (at lest for the version of 0.8dev I tested this with). always_comb is a rather "low-level" decorator, very close to implementation and synthesizable code. I don't think it has many uses in high-level modeling. Therefore, I don't think it should try to support all kinds of high-level data structures. I think things should currently work for lists of Signals, even "hetero_list" unless not all items are Signals. In that case, I think you get what you deserve :-) (even in Python, I think lists are intended to consist of similar objects.) But for dicts, I don't see the case. Again here, in general, all members should become part of the sensitivity list. We do that for lists, but I don't really see the use case for dynamically indexed dicts. And if it's only static indexing - again, attributes are the right tool. I take the point for attribute lookup though - patches welcome. > In [76]: x = Signal(False) > ...: y = Signal(False) > ...: con1 = {'x':Signal(False)} > ...: con2 = [Signal(False), > 'gibberish', > Signal(intbv(0, min=-234, max=19987))] > ...: class Container(object): x = Signal(False) > ...: con3 = Container() > ...: > > In [77]: @always_comb > ...: def sim_sig(): > ...: x.next = y > ...: > > In [78]: @always_comb > ...: def sim_con1(): > ...: x.next = con1['x'] > ...: > --------------------------------------------------------------------------- > AlwaysCombError Traceback (most recent call last) > ... > AlwaysCombError: sensitivity list is empty > > In [79]: @always_comb > ...: def con2(): > ...: x.next = con2[0] > ...: > --------------------------------------------------------------------------- > AlwaysCombError Traceback (most recent call last) > .. > AlwaysCombError: sensitivity list is empty > > In [80]: @always_comb > ...: def sim_con3(): > ...: x.next = con3.x > ...: > --------------------------------------------------------------------------- > AlwaysCombError Traceback (most recent call last) > ... > AlwaysCombError: sensitivity list is empty > > > Regards, > Chris F. > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ -- 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 |