ASM Conditional Output Declarations

examples

Conditional outputs are created by using asm_cond statements. The format of an "asm_cond" statement is given below.

  asm_cond statement_name,next_statement,o=(outputs)

The statement_name field is a unique name that is assigned to the statement. The next_statement field is the name of the statement that follows this one in the flow chart of the circuit. The outputs field is a list of outputs that must be activated when the conditional output is activated. This statement should follow one or more asm_test statements. The next_statement field may name an asm_state, an asm_test, or another asm_cond statement.

All outputs that appear on asm_state and asm_cond statements must be declared as primary outputs of the circuit containing them. Furthermore all conditions that appear on an asm_test statement must be declared as primary inputs of the circuit. All primary inputs and outputs of an ASM must have width 1, although they may be declared as active-high or active-low. When an active-low output is activated its value is set to zero, otherwise it is set to one. When an active-high output is activated, its value is set to one otherwise it is set to zero. If an output is not mentioned in a state, it will be set to its inactive value.

For active-high conditions, zero is treated as false and one is treated as true. For active-low conditions, zero is treated as true and one is treated as false.

You must be careful that each statement belongs to only one state. In other words it must not be possible to go from two asm_state statements to a particular asm_test or asm_cond statement without going through another asm_state. You will get several error messages if you violate this rule. (If you violate this rule it is impossible to build a circuit corresponding to the ASM specification, even if you could manage to simulate it in software.)