[myhdl-list] Re: always_comb / signal array
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2004-11-24 17:17:32
|
David Brochart wrote: > Selon David Brochart <dav...@fr...>: > > >>It seems that "always_comb" doesn"t work when an input is an array of >>signals, >>while it works fine with the "while 1 / yield" structure. >> >>David. >> > > > > Actually, according to previous threads I read, I am not sure if it should even > work with the "while 1 / yield" structure, because generators only deal with > signals, not lists of signals. > Jan, could you clarify this point? Sure. MyHDL has a number of objects on which you can "wait" using a yield statements, such as a delay, edges and also signals. (Waiting on as signal is defined as waiting on a signal value change.) A list of signals is *not* one of these objects. To specify the sensitivity "list" in the yield clause, the syntax with the smallest overhead is convenient: yield a, b, c, d As per the Python definition, this is equivalent to: yield (a, b, c, d) that is, yielding a tuple. As often, when a tuple is supported, it is trivial to support a list also, and that's what MyHDL does. So it is in this indirect way that you can use a list of signals (or any other "event" object) as a sensitivity list in the yield clause. Remaining question: does all this have applications? Well, I added list support for a real modelling project. In fact, the concept of a "dynamic sensitivity list" is, I believe, a unique feature of MyHDL. You can build your sensitivitly lists (and tuples) dynamically, depending on dynamic control info, and it will all work as expected. I haven't explicitly documented or advertized this feature though, because I don't yet know how significant it actually is. Regards, Jan -- Jan Decaluwe - Resources bvba - http://jandecaluwe.com Losbergenlaan 16, B-3010 Leuven, Belgium Python is fun, and now you can design hardware with it: http://jandecaluwe.com/Tools/MyHDL/Overview.html |