AR# 3151: 4.2i Foundation State Editor, XABEL - The one-hot state machine I create is "cold" (It will not move from the "000" state)
4.2i Foundation State Editor, XABEL - The one-hot state machine I create is "cold" (It will not move from the "000" state)
Keywords: ABEL, one-hot, one hot, FSM, initialize
General Description: When I create a one-hot state machine through Foundation State Editor using ABEL as the synthesis language, the state machine produced is "cold" (i.e., it never moves from the "000" state).
This problem occurs because the ABEL code is produced with all state registers initializing to "0". This means that the state machine powers up to all "0"s; therefore, it is not in any state in the one-hot encoded state machine.
To work around this problem, manually edit the ABEL code so that the code initializes to the initial-state. Do this by adding the following line to the "Equations" section of the ABEL code:
<INIT_STATE>.AP = 0;
where <INIT_STATE> is the desired initial state.
This forces this particular state register to be a "preset" register, which will power-up to "1"; therefore, the one-hot state machine will be in this state at the start.
If you use the previous method to work around the problem, but then make further revisions to the state diagram, the ABEL code is regenerated and the initial condition is lost.
You may apply an initial condition that will not be overwritten by writing the initial condition in the "//diagram ACTIONS" box at the top of the State Editor. Do this by double-clicking on the "//diagram ACTIONS" box, then writing on the line below it: