David G. Koontz wrote:
> 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 ?
>>
> You didn't pass write matrix for display after initialization.
sorry, 'right', not 'write'.
Try this for a different assignment to state2 for the shift:
-- state2:=next_state_column & state2(3 downto 1);
state2:=matrix'(0 => next_state_column , 1 => state2(3),
2 => state2(2), 3 => state2(1));
This appears to give the 'right' answer. I'd have to think about it and
read up in the LRM, but it sounds like the original sequential assignment
statement commented above is having an attribute inheritance issues (range
and/or direction). The question is whether or not the issue is valid.
You can see in the immediately above qualified expression that matrix (which
has a deferred range) defaults to a rising natural range. We also know that
state2 has a natural range declared as descending ( downto ).
It would appear that LRM 7.3.2.2 Array aggregates is the place to look.
(And it is confusing).
_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss