-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tdcc
: Incorrect early transitions in presence of par
#662
Comments
Argh, just came across a slightly different version of the above example where the control program is:
My initial thought was that I could just change the compilation of This means that |
Did this get fixed? If so I'm curious what the correction was |
Nope, incorrectly closed. The problems is explained here: #651 (comment) |
The integration test for |
tdcc
: Incorrect FSM generated in presence of par
tdcc
: Incorrect early transitions in presence of par
The following program incorrectly computes the final value in
y_int0
to be0
. The expected value is1
:The
false
group sets the value incomb_reg
to0
whiletrue
sets it to1
. At the end of the program, we expect the value incomb_reg
to be1
sincetrue
will execute on all program paths.However,
tdcc
generates the following code for the FSM and thepar
compilation:Group generated for top-level FSM:
The first
par[go]
statement represents the early transition.The problem is that both
true[done]
andfalse[done]
point tocomb_reg.done
. This creates the following cycle-by-cycle behavior:false
starts executingfalse
is done executing andpar
starts executing. However, the guard intrue[go] = !(pd.out | true[done])
is false becausetrue[done] == false[done]
. This also means thatpd.in = true[done] ? 1'd1
will execute.true[go] = !(pd.out | true[done])
still doesn't execute because the previous cycle wrote1
intopd
.This means that
true
is never executed causing the unexpected output to be generated.The problem is very similar to a previous bug in
tdcc
where thedone
signal from a previous cycle was being used to stop the execution of a group in the current cycle. A possible solution to this problem is exending the guard in thepar
to be:A higher-level statement of this problem is that while registers are allowed to be shared, their
done
signals cannot be. This class of bus arise from the fact that when we share registers, we invariably end up sharing theirdone
signals as well. The style of fixes to this set of problem is making sure that all thedone
signals are "indexed" in the right FSM state (i.e. read in the FSM state that they should be read in).The text was updated successfully, but these errors were encountered: