Re: [myhdl-list] always_comb from a change in Signal list does not get triggered
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2008-06-20 08:52:51
|
Günter Dannoritzer wrote: > Hi, > > I am trying to create a word wide shift register and the output register > is connected with an always_comb to the output signal of the function. > Now this always_comb gets only triggered one time, even so I see the > output register signal change during the shift operation. > > This is my code: > > def pipe(clk,en,din, dout, N,width): > > pipe = [Signal(intbvSigned(width)) for i in range(N)] > > print "N: ", N > > @always(clk.posedge) > def rtl1(): > if en: > for i in downrange(N,1): > print "i: %d"% i > pipe[i].next = pipe[i-1] > pipe[0].next = din > print "pipe: %s"% pipe > > > @always_comb > def rtl2(): > print "pipe[N-1]: %d"% pipe[N-1] > dout.next = pipe[N-1] > > > return instances() > > > > I attached the test bench for it. Running the test bench will fill the > pipe with values and print the output dout. > > I changed the code so that the pipe memory has only N-1 entries and dout > being the Nth register, which worked fine. I just would like to know > what I am doing wrong so that the always_comb gets not triggered anymore? always_comb doesn't understand lists of signals, or any composite type that would contain signals for that matter. It only can handle signals with a plain name in the code. Handling composite types such as lists of signals raises many question e.g. about efficiency. Also, this is certainly a construct that people will expect to be convertible - which raises many question on itself. Obviously the current situation were you are not warned is not OK. But I think the best thing to do is explicity check for the types that you can use and give an error otherwise, and ask people to use an explicit "always" to control exactly what they want. BTW, in this case you wouldn't need an "always_comb" block at all, you could just write: dout = pipe[N-1] to make dout and "alias" of the last pipe signal. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |