Rational Statemate supports the textual elements (types, sub-types, and structures) described in the following table.
•
•
• Aliases are supported with the generated code the same as for compounds, a macro with the alias name and definition. A data-type that consists of several fields of possibly different types. A user-defined type is analogous to thetypedef
statement in C or thetype
is
statement in Ada.User-defined types are often required to be visible throughout the entire model, so they are usually defined in a global definition set. A persistent signal whose value is either TRUE or FALSE. Something occurring over a span of time, for example, the light is on. All conditions are enclosed in square brackets (for example, [C]).In general, the actiontr!
(C)
has the effect of setting the truth value of condition C to true, and the corresponding actionmake_false
(C)
(abbreviatedfs!
(C)
sets it to false. (Contrast with Event.) An instantaneous signal used for synchronization purposes. An event indicates that something has happened.Events occur at a precise instant in time, and if not immediately sensed they are lost. Events “live” only for the duration of the step immediately following their occurrence. (Contrast with Condition.) A single action can consist of making an assignment, generating an event, invoking a defined (named) action, or several special types of expressions (starting/stopping/ suspending activities, clearing history, etc.). Information flows are containers for other elements (such as conditions, events, data items, and other information flows). They reduce the number of flow lines, which makes the chart more readable and helps the viewer to better comprehend the specification. In addition to basic types, a data item can be a composite of named components, referred to as fields, each of which can be a data item of any type or a condition.Rational Statemate supports two kinds of composites: records and unions. The entire construct is referenced by its name (e.g., on a flow line), while a particular field is referenced using the dot notation:
•
•
• In addition, any C code that has been used to describe subroutines within a model can automatically be included within the generated code.Subroutines have textual information like any other Rational Statemate element (for example, short description, long description, and attributes). One of five primitive data types in the Rational Statemate language. (The other four are: real, bit, bit array, and string.)The maximum value of integers allowed depends on the architecture of the machine on which Rational Statemate is running. On a 32-bit machine, it is (2**31)-1. One of five primitive data types in the Rational Statemate language. (The other four are: integer, bit, bit array, and string.)A real is also sometimes called a floating point number. In Rational Statemate, values can be referred to in either ‘nnn.mmm’ form or ‘n.mmm E+ee’ form. The values allowed depend on the architecture of the machine on which Rational Statemate is running. This is usually in the range -1.0 E+38 to 1.0E +38. One of five primitive data types in the Rational Statemate language. (The other four are: integer, real, bit array, and string.) One of five primitive data types in the Rational Statemate language. (The other four are: integer, real, bit, and string.)A bit array is an array of bits. The length and indices are specified when the element is defined. The defaults values are: length - 32 bits, right index (most significant bit) - 31, and left index (least significant bit - 0.Bit arrays are treated as unsigned numbers by Rational Statemate. The software supports both implicit and explicit conversion to other Rational Statemate types. One of five primitive data types in the Rational Statemate language. (The other four are: integer, real, bit, and bit array.)A string can hold any number of characters up to its defined length. The default length for a string is 80 characters. A data type that consists of several fields of possibly different predefined types or user-defined types. When a data item is declared to be a record, it is defined to contain all of its fields. A record is analogous to a structure in C and a record in Ada.You access a field in a record by using both the record name and field name separated by a ‘.’ (for example, RECORD_NAME.FIELD_NAME).Aliases are supported with the generated code the same as for compounds, a macro with the alias name and definition. A data type that consists of several fields of possibly different predefined types or user-defined types. When a data item is declared to be a union, it is not defined to contain all of its fields. Rather, it is defined to contain one of its possible fields at any point in time. A union is analogous to a union in C and a variant record in Ada.You access a field in a union by using both the union name and field name separated by a ‘.’ (for example, UNION_NAME.FIELD_NAME). A data type that consists of several fields of possibly different types. A user-defined type is analogous to thetypedef
statement in C or thetype
is
statement in Ada.User-defined types are often required to be visible throughout the entire model, so they are usually defined in a global definition set. Enumerated values are constants. In Rational Statemate you can define a User-Defined Type (UDT) to be an enumerated type, and then define enumerated values for this type.For example, you can define a UDT as enumerated type COLOR, and then define COLOR as {RED, GREEN, BLUE, YELLOW}. These colors are enumerated values that you can use in expressions (such as/X:=RED;
). A one-dimensional (vector) grouping of data items, events, and conditions under a single name whose individual elements are addressed through a reference index. An ordered, unlimited collection of data items, all of the same data type. This data type can be any predefined or user-defined type. A queue is essentially a single structure that holds many elements. These elements can be put in at either the front or the back, but can only be retrieved at the front.
•put!
adds the value of the expression to the queue’s tail.
•uput!
adds the value of the expression to the queue’s head.Note: Put actions are accumulated and performed at the end of the step. This scheme reduces the chances of race conditions.
•get!
actions are performed when they are encountered.
•peek!
copies the queue’s head element without removing it.
•fl!
totally clears the queue.
•q_length
returns the length of the queue.Note:
When defining a User-Defined Type and selecting Data Type "User Type" (i.e. defining a sub-type of the selected User-Type), the properties form shows a "Type Ranges" button.If the User Type is Integer or Real, the "Type Ranges" button is used to define Min/Max values of the int/real sub-type.
If the User Type is an Enumerated Type, the "Type Ranges" button is used to define Default Value of the enum sub-type.