A
alb
Guest
On 24/09/2013 19:21, Andy wrote:
flags to control sub-procedures calling are just the state of the FSM,
while sub-procedures operate on global variables.
I started off by 'encapsulating' the reusable states in separate
procedures, but I was not sure how to 'wait' the end of it, that is why
I ended up putting everything under a single FSM.
That is true indeed. Apparently the FSM explorer does not recognize an
FSM. Definitely not good, a hierarchical approach becomes definitely
mandatory.
The fact that my RTL looks messier than what I think should have been a
clear hint that something is wrong.
Al,
I think you need flags to control calling the sub-procedures within
autoread, not calling autoread itself. It looks like you would also
need variables to hold the parameters you are going to pass to some
of your sub-procedures.
flags to control sub-procedures calling are just the state of the FSM,
while sub-procedures operate on global variables.
After reviewing your FSM though, I think you might do better with
separate, smaller state machine(s) for the reusable states, and
implement a hierarchical state machine. There is no point in
combining all the reusable and unique states into the same FSM.
I started off by 'encapsulating' the reusable states in separate
procedures, but I was not sure how to 'wait' the end of it, that is why
I ended up putting everything under a single FSM.
Does Synplify actually recognize your FSM as an FSM (what does it
look like in the RTL viewer or FSM explorer)? Sometimes if you assign
the next state from the contents of a register other than the current
state, Synplify will not treat it as a state machine, which then
excludes optimizations normally performed on FSMs.
That is true indeed. Apparently the FSM explorer does not recognize an
FSM. Definitely not good, a hierarchical approach becomes definitely
mandatory.
As for my example that illuminated the synthesis problem, the
procedure's logic was complex enough that any abnormalities would not
have been easy to spot in RTL view. Unfortunately, Synplify unrolls
functions and procedures for RTL view.
The fact that my RTL looks messier than what I think should have been a
clear hint that something is wrong.