Closed togulcan closed 2 years ago
Not directly a problem with extern
architecture states, but rather with the mechanism how slice expressions are parsed. To the parser, slicing and indexing looks the same: MEM[23] looks the same as
ITSTATE[3], but
MEMis an array whereas
ITSTATE` is a scalar. Therefore indexing and slicing expressions are dependent on the context. I fixed this in e83d31621d4d8e94b4e34b723c042e6455570847, please check if this solves the issue.
One comment: ITSTATE
is more of a register
than an extern
type. extern
declared entities usually refer to memory banks of some form.
Yes, it is solved!! Many thanks. I will pay attention to the declaration as a register as well, thanks!
Hello
I just realized the following code:
is producing the following code:
where you might have already seen the resulting indexes of
ITSTATE
after slicing are completely wrong.However when I create a local copy of the extern variable
ITSTATE
as follows:The following true expected code is generated.
But why this is happening in the first place even though
states
andITSTATE
are of the same type ofetiss_uint8
? Is there something wrong with extern variables?Thanks