Re: [myhdl-list] Beginners question
Brought to you by:
jandecaluwe
From: Thomas H. <th...@py...> - 2006-09-27 17:32:53
|
Jan Decaluwe schrieb: > Thomas Heller wrote: >> If I have two or more events in an always decorator: >> >> @always(a.negedge, b.negedge, delay(10)) >> def func(): >> ... >> >> how can I determine inside func which event is currently handled? > > Currently there is no direct way. For edges and signals, it may > be possible to support this by making sure that certain > attributes (e.g. 'negedge') can be checked in code. But that > is not possible currently (that is, it won't work as expected). > For other things, such as delays, it's not clear how to do it. > > However, do we actually need this? > For synthesizable code, the classic synthesis templates are such > that the relevant checks are done implicitly by the > top-level if-then-else structure. > > For non-synthesizable code, you have the option of using > separate always blocks, each triggered by the relevant condition. > Well, I guess the answer is "don't do this" anyway. It seems I have still to switch from the more software oriented mental model back to hardware oriented. Thanks, Thomas |