Re: [myhdl-list] Wait within @always()
Brought to you by:
jandecaluwe
From: Ben <ben...@gm...> - 2011-08-03 09:00:21
|
On Wed, Aug 3, 2011 at 09:50, Uri Nix <ur...@gm...> wrote: > Hi, > > I'm using MyHDL to model a FSM, and would like to wait/delay the state > transitions, something like this: > > @always(clk.posedge) > def logic(): > if state == t_State.ONE: > state.next = t_State.TWO > # wait for something comparable to myhdl.delay(x) > ... > > If I understand correctly, this would require changing the function's > sensitivity list dynamically - is it possible? > I'd prefer to keep using the @always() pattern instead of yielding > explicitly. > You can achieve something similar by using a DelayedSignal instead of a standard Signal. The drawback is that every next on this signal will be delayed. You just have to specify a "delay" value while defining your signal. I'm not sure this is documented, look at the code if in doubt. Regards, Benoit |