![]() |
|
![]() |
|
Answers Database
F1.5iS2: Using block statement structures using {,}s in Abel state machine assignments may cause incorrect equations
Record #6286
Product Family: Software F1.5iS2: Using block statement structures using {,}s in Abel state machine assignments may
cause incorrect equations
Problem Description: Urgency: Standard General Description: Using {,}s to enclose a state equation will cause the assignement to be ignored. 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 equations: " State1.D = (InitState.Q); " State2.D = (InitState.Q); "Instead of the expected equations: " State1.D = (InitState.Q & A); " State2.D = (InitState.Q & !A & B); Solution 1: According to ABEL syntax, the compiler is looking for a single state equation suchas 'State1' or 'goto State1' therefore the use of {,}s, which indicates the inclusion of multiple statements, is of no meaning. Without the {,}s the abel code is compiled to the correct equations. When the {,}s are included, the condition attached to the statement is ignored. If the state machine needs to transition to the next state with ceritain registers set then a 'WITH' statement should be used. An enhancement request has been filed for the syntax checker to produce an error or warning when {,}s in conjunction with state equations. End of Record #6286 - Last Modified: 04/26/99 08:49 |
| For the latest news, design tips, and patch information on the Xilinx design environment, check out the Technical Tips! |