[myhdl-list] Re: always_comb / signal array
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2004-11-24 17:32:31
|
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. Sure. MyHDL defines a number of "event" objects that you can "wait" on using a yield statement, such as a delay, edges and also signals. (Waiting on a signal is defined as waiting on a signal value change.) A list of signals is *not* such an event object. To specify the sensitivity "list", the syntax with the least amount of overhead is convenient: yield a, b, c As per the Python definition, this is equivalent to: yield (a, b, c) that is, yielding a tuple. Often, when a tuple is supported, it is trivial to support a list also, and that is what MyHDL does. So it is in this indirect way that you can use a list of signals (or other event objects) as a sensitivity list. Remaining question: does this have applications? Well, I added list support when I needed it during a real modelling project. Actually, the concept of a "dynamic sensitivity list" is, I believe, a unique feature of MyHDL. You can build lists (and tuples) dynamically, based on dynamic control info, and use them as a sensitivity list that will work as expected. I haven't document of advertized this feature though, because I don't yet know how significant it 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 |