AR# 6286: Foundation 4.2i - If block statement structures use {,}s in ABEL state machine assignments, incorrect equations are produced
AR# 6286
|
Foundation 4.2i - If block statement structures use {,}s in ABEL state machine assignments, incorrect equations are produced
描述
Keywords: XABEL, ABEL, .abl, state machine, goto, state equation, incorrect
Urgency: Standard
General Description: When I use {,}s to enclose a state equation, the assignment is ignored.
For example:
state_diagram Sreg async_reset InitState : CLR;
state InitState: if !(A # B) then InitState; else if (A) then {goto State1;} else {goto State2;} state State1: goto InitState; state State2: goto InitState;
The simple state machine coded above will produce the following equations:
According to ABEL syntax, the compiler is looking for a single state equation such as "State1" or "goto State1". Because the use of {,}s indicates the inclusion of multiple statements, they have no meaning in the ABEL syntax.
When {,}s are not used, the ABEL code will compile the correct equations. When {,}s are included, the condition attached to the statement is ignored.
If the state machine must transition to the next state with certain registers set, a "WITH" statement should be used.
(An enhancement request has been filed for the syntax checker so that an error or warning will be reported when {,}s are used in conjunction with state equations.)