Re: [myhdl-list] always_comb from a change in Signal list does not get triggered
Brought to you by:
jandecaluwe
|
From: Thomas T. <tho...@de...> - 2008-06-13 10:37:31
|
Günter Dannoritzer wrote:
> 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 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?
I think this is a bug in myhdl.
BTW, some related comments/questions:
> for i in downrange(N,1):
> pipe[i].next = pipe[i-1]
The following should also work:
for i in range(1,N):
pipe[i].next = pipe[i-1]
It will not override, the current value because you write to the
next-attribute.
In your simple example you could put the
dout.next = pipe[N-1]
inside the rtl1 generator so you don't need rtl2 (you probably know it,
your code might be a simplification).
Also in this simple case. Is there something bad about the following
code, using a @always instead of @always_comb ?
@always(clk.posedge)
def rtl2():
Have a nice weekend,
Thomas
--
Thomas Traber
DESY, MDI
Notkestrasse 85
D-22603 Hamburg, Germany
email: tho...@de...
phone: +49 40 8998 4246
|