Sylvere TEISSIER wrote:
> Hello,
> I have a strange bug in specific code, for more detail read the source
> in attachement.
>
> also in attachement: Makefile, output from ghdl(wrong) and output from
> modelsim(right)
>
> Can you confirm the bug ?
>
>
Ya, the bug shows up. Not the way you think.
I got suspicious when I could change the state2 shift to get a correct
matrix and state 3 showed up correct.
Also found an error in your code:
--- making sure that state=state2=state3 via plotting
debugState(state,"State");
-- debugState(state,"State2");
debugState(state2,"State2");
-- debugState(state,"State3");
debugState(state3,"State3");
You didn't pass write matrix for display after initialization.
You do this post shifting too:
--- plotting output: method 2 and 3 give bad result
debugState(state,"State after fifo insertion");
debugState(state2,"State2 after fifo insertion");
-- debugState(state2,"State3 after fifo insertion");
debugState(state3,"State3 after fifo insertion");
I found these by changing the initialization values for state2 and state3
because it looked like something to do with pointers:
-- state2:=state;
state2:=(x"84838281",x"74737271",x"64636261",x"54535251");
-- state3:=state;
state3:=(x"c4c3c2c1",x"b4b3b2b1",x"a4a3a2a1",x"94939291");
Fixing the debugState() calls allows you to see that it is only the state2
shift you're having trouble with. Your diagnostic call for state3 was using
the matrix for state2.
_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss