Learning BSV‎ > ‎Attributes‎ > ‎

execution_order Attribute

Overview

With the execution_order attribute, the designer can specify that, when two rules fire in the same cycle, one rule should sequence before the other. This attribute is similar to the descending_urgency attribute except that it specifies the execution order instead of the urgency order. The execution_order Attribute may occur in the same syntactic positions as the descending_urgency attribute and takes a similar argument, a string containing a comma-separated list of rule names

If two rules cannot execute in the order specified, because of method calls which must sequence in the opposite order, for example, then the two rules are forced to conflict.

Attribute Syntax

    (* execution_order = "r1, r2, r3" *)

The argument of the attribute is a string containing a comma-separated list of rule names. The example above specifies that r1 should execute before r2 which, in turn, should execute before r3.

The execution_order attribute can be placed:

  • immediately before the rule keyword in a rule...endrule- construct, in which case it can refer to any of the rules in the expression
  • immediately before the rules keyword in a rules...endrules construct, in which case it can refer directly to the rule or any other rules at the same level
  • immediately before the module keyword in a module...endmodule construct, in which case it can refer to any of the rules inside the module.
Comments