![]() |
![]() |
![]() |
![]() |
![]() |
Dynamic Errors
Violations of the dynamic rules of SDL will cause dynamic errors during the execution of a simulation program. A dynamic error is presented to the user on the screen as an error message. See the example below.
Example 334 : Dynamic Error Printout
Warning in SDL Output of signal BumpSignal sent to NULL, signal discardedSender: Demon:1TRANSITIONProcess : Demon:1State : GenerateInput : TSymbol : #SDTREF(SDL,/usr/tom/demon.spr(1),122(30,55),1)TRACE BACKProcess : DemonBlock : DemonBlockSystem : DemongameThe symbol reference given in the TRANSITION message should be interpreted as follows:
By entering the monitor command Show-Previous-Symbol, the symbol that caused the error is displayed.
For more information on references, see SDT References.
Dynamic Errors Found by a Simulation Program
Error in SDL array index in sort <sort>:<value> is out of range.Violation of the index range given in an array.
Error in assignment in sort <sort>:<value> is out of range.Violation of the range conditions given in a syntype.
Error in SDL Decision: Value is <value>Entering decision error stateThe value of the expression in the decision did not match any of the possibilities (answers).
Error in SDL Import. Attempt to import from NULLError in SDL Import. Attempt to import from stopped process instanceError in SDL Import. Attempt to import from the environmentError in SDL Import. No process exports this variableError in SDL Import. The specified process does not export this variableError in an import statement. Supplementary information about remote variable and exporting processes is also given.
Warning in SDL Output of signal <signal>.No path to receiver, signal discardedAn attempt was made to output a signal to a PId expression. There exists, however, no path of channels and signal routes between the sender and the receiver that can convey the signal.
Warning in SDL Output of signal <signal>.No possible receiver found, signal discardedAn attempt was made to output a signal without specifying a to PId expression. When all paths or all paths mentioned in a via clause had been examined no possible receiver was found.
Warning in SDL Output of signal <signal>.Signal sent to NULL, signal discardedAn attempt was made to output a signal to a PId expression that was null.
Warning in SDL Output of signal <signal>.Signal sent to stopped process instanceAn attempt was made to output a signal to a PId expression that referred to a process instance which has performed a stop action.
Error in SDL View. Attempt to view from NULLError in SDL View. Attempt to view from stopped process instanceError in SDL View. Attempt to view from the environmentError in SDL View: The specified process does not reveal this variableError in SDL View: No process reveals this variableError in a view statement. Supplementary information about viewed variable and viewing process is also given.
Error in SDL Create: Process <process>More static instances then maximum number of instances.Illegal #UNION tag value for assignment to component Name.Tag value is xxx.Attempt to assign a value to a non-active UNION component.
Illegal #UNION tag value for access to component Name.Tag value is xxx.Attempt to access a non-active UNION component.
Error when accessing component Name. Component is not Present.Attempt to access a non-active optional struct component.
Component Name is not active.Present is xxx.Attempt to access a non-active choice component.
Dereferencing of NULL pointer.Pointer assigned new data area at address: HEX(xxx)Attempt to de-reference a Null pointer defined using the Ref generator.
User specified error: SDL error expression foundError introduced by the user, by inserting the error expression defined in SDL.
Errors Found in Operators
The errors that can be found in operators defined in the predefined data types are listed below.
Error in SDL Operator: Extract! in sort Charstring, Index out of boundsError in SDL Operator: Modify! in sort Charstring,Character NUL not allowed.Error in SDL Operator: MkString in sort Charstring,Character NUL not allowed.Error in SDL Operator: First in sort Charstring, Charstring length is 0Error in SDL Operator: Fix in sort Integer, Integer overflowError in SDL Operator: Last in sort Charstring, Charstring length is 0Error in SDL Operator: Substring in sort Charstring, Charstring length is 0Error in SDL Operator: Substring in sort Charstring, Length of substring < 0Error in SDL Operator: Substring in sort Charstring, Start index is <= 0Error in SDL Operator: Substring in sort Charstring, Start index + length of substring > length of charstringError in SDL Operator: / in sort Integer, Attempt to divide by 0.Error in SDL Operator: / in sort Real, Attempt to divide by 0.0.Error in SDL Operator: Rem in sort Integer,Second operand is 0Error in SDL Operator: Mod in sort Integer,Second operand is 0Error in SDL Operator: Modify! in sort Bit_String,Index out of bounds.Error in SDL Operator: Extract! in sort Bit_String,Index out of bounds.Error in SDL Operator: First in sort Bit_String,Bit_String length is zero.Error in SDL Operator: Last in sort Bit_String,Bit_String length is zero.Error in SDL Operator: SubString in sort Bit_String,Bit_String length is zero.Error in SDL Operator: SubString in sort Bit_String,Start is less than zero.Error in SDL Operator: SubString in sort Bit_String,SubLength is less than or equal to zero.Error in SDL Operator: SubString in sort Bit_String,Start + Substring length is greater than string length.Error in SDL Operator: BitStr in sort Bit_String,Illegal character in Charstring (not 0 or 1).Error in SDL Operator: HexStr in sort Bit_String,Illegal character in Charstring (not digit or a-f).Error in SDL Operator: Modify! in sort Octet,Index out of bounds.Error in SDL Operator: Extract! in sort Octet,Index out of bounds.Error in SDL Operator: Division in sort Octet,Octet division with 0.Error in SDL Operator: Mod operator in sort Octet,Right operand is 0.Error in SDL Operator: Rem operator in sort Octet,Right operand is 0.Error in SDL Operator: BitStr in sort Octet,An Octet should consist of not more than 8 characters 0 or 1.Error in SDL Operator: HexStr in sort Octet,An Octet should consist of 2 HEX values.Error in SDL Operator: HexStr in sort Octet,Illegal character in Charstring (not digit or a-f).Error in SDL Operator: Modify! in sort Octet_String,Index out of bounds.Error in SDL Operator: Extract! in sort Octet_String,Index out of bounds.Error in SDL Operator: BitStr in sort Octet_String,An Octet_String should consist of 0 and 1.Error in SDL Operator: HexStr in sort Octet_String,Illegal character in Charstring (not digit or a-f).Apart from these error message each instantiation of generator String will introduce similar error messages as for the Charstring sort. Note that Object_Identifier is a predefined sort which is an instantiation of String.
Action on Dynamic Errors
After a dynamic error, the execution of the simulation program is continued until the current symbol is ended. The interactive monitor will then become active. The following actions will be taken:
- If the error was an output error the signal will not be sent.
- If the error was a decision error the process instance will immediately be placed in an decision error state. It can only be removed from this state by using the Nextstate command in the monitor. The input port will not be affected when the decision error state is entered. All signals sent to a process instance in a decision error state will be saved in the input port.
- If the error occurred during the creation of static process instances, i.e. the initial number of instances is greater that the maximum number of instances, an error message is given and the number of instances specified by initial number of instances are created.
- If the error occurred during an import or view action a data area of the correct size containing zero in all positions is returned.
- If the error was found in a range condition check during an assignment, the variable to the left of the assignment operator will be assigned the computed value, although it is out of bounds.
- If the error was found during a range check of an array index the index value will be changed to be the lowest value of the index type. This means that the corresponding C array will never be indexed out of its bounds.
- If the error occurred during selection of an optional component in a struct or when selecting a component in a #UNION or Choice, an error message is given and the operation is perform anyhow.
- If a Null pointer (Ref) is de-referenced, an new data area of correct size is allocated containing zeros. This data area is assigned to the pointer. After the error message the statement containing the de-referencing is performed.
- If the error occurred within an expression the operator that found the error returns a default value and the evaluation of the expression is continued. The default values returned depend on the result type of the operator and are given in section Default Values.
Assertions
A user can define his own run-time errors or assertions. Basically the run-time library only provides an appropriate C function that can be called to print out an error message. This function is assumed to be used in #CODE directives in TASKs according to the following example:
Example 335 : Assertion in C Code
TASK '' /*#CODE#ifdef XASSERTif (#(I) < #(K))xAssertError("I is less than K");#endif*/ ;The xAssertError function, which has the following prototype:
extern void xAssertError ( char *Descr )takes a string describing the assertion as parameter and will produce an SDL run-time error similar to the normal run-time errors. The function is only available if the compilation switch XASSERT is defined. For the standard libraries this is true for all libraries except the Application Library.
Run-time Prompting
For some special SDL constructs, an SDL simulator is not able to continue executing without prompting the user for necessary input. The execution continues when the user has entered an allowed value.
Decision with Any
If an SDL DECISION is encountered with an ANY question, the user will be prompted which path to execute:
Decision with ANY1 (go path)1 ? (show path)2 (go path)2 ? (show path)3 (go path)3 ? (show path)Enter path :At this point, the user must enter a path value (integer) within the allowed range. If GR trace is enabled, the user may enter a path value followed by a `?' to see the corresponding path in an SDL Editor.
Informal Decision
If an SDL DECISION is encountered with informal text, the user will be prompted which path to execute:
Informal decision: `Question1'`answer1' 1`answer2' 2`ELSE' 3Enter path :At this point, the user must enter a path value (integer) within the allowed range. If GR trace is enabled, the user may enter a path value followed by a `?' to see the corresponding path in an SDL Editor.
Unimplemented Operator
If an expression is encountered involving an operator that is not implemented, the user will be prompted for the value to be returned depending on the parameters:
Operator op in sort s is calledParameter 1: 50Enter value(s) :At this point, the user must enter a value in the resulting sort to be the returned value of the operator when called with the listed parameter values.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |