User-Defined Type Functions
There are a number of functions provided for manipulating Rational Statemate model variables that should be used when augmenting the Rational Statemate generated code.
Note: Rational Statemate variable values may be read by checking the correct variable name. Value changes, however, should not be made directly to the same variable. All value changes are made through a list of variables to be updated. This list is affected through a variety of functions created by the code generator.Use the call
seti(variable_name’address, value);
to set any (primitive) integer variable to a desired value. Other similar calls provide the ability to set conditions, strings, real numbers, etc. In addition to these general functions, the Code Generator creates similar functions that are specific to each User-Defined Type (UDT).Every UDT has the following functions defined for it:
It uses the update list to assign A:=B. The user-code should not make direct assignments to Rational Statemate variables. Use the following set functions to test for equality:
Returns TRUE if the elements A and B are equal.
For every type that has a corresponding _event declaration, the following functions are defined:
function ALL_<type>
(A : <type>_event) return boolean;These functions test to see if all the events that form A are currently generated. This example only applies to
RD<element>
andWR<element>
.procedure GEN_<type>
(A : <type> (A : <type>_event);These functions generate all the events in A. This only applies to
RD<element>
andWR<element>
.