Closed kiteloopdesign closed 3 years ago
Hi,
You need to pass the parameter True on the assignment to get the blocking assignment.
myvar= m.Reg ('myvar', width = 4 , initval = 0 )
logic_wire= m.Reg ('logic_wire', width = 1 , initval = 0 )
decCond = []
decCond.append (vg.When ( 0 ) (logic_wire ( 1 ,True)))
# ... more conditions ...
decCond.append (vg.When () (logic_wire ( 5 ,True)))
m.Always( ) ( vg.Case (myvar) (* decCond ) )
Cool, obrigado Lucas, it does work indeed It would be awesome to throw all these examples into the wiki, it should not take long and save you guys a bunch of qeustions!
I am trying to create a case statement within a combinational block, but I am not getting the blocking assignment it should be inferred. I am getting instead a non-blocking ("<=") assignment instead.
Any idea on how to get this done? This is what my code looks like
Thanks!