![]() |
![]() |
![]() |
![]() |
![]() |
SDL Instance Information
The Analyzer supports the generation of a so-called instance information file, with the file extension .ins. This file contains various kinds of information about an SDL system. Similar to a cross reference file, it is a plain text file. The file syntax is described in detail in File Syntax. The Analyzer invokes a tool called the Instance Generator to produce the instance information out of an analyzed SDL system.
The information that can be found in an instance information file helps to answer many questions. For example:
- How does a complex SDL-92 system look after instantiation of all types, i.e. when all inheritance hierarchies have been flattened out? Finding this information about the instance structure of a system directly from the SDL/PR file is a non-trivial task. Therefore, one of the main objectives behind the Instance Generator is to provide this "instance view" of a system.
- Which signals can be conveyed on a certain channel or signal route in a certain direction?
- What is the valid input signal set of a process?
- Which states does a process contain?
- Which transitions will take place if a certain signal is received by a process being in a certain state?
- Which output signals might be sent during a transition?
- Which procedures might get called during a transition?
- What is the set of possible nextstates after a transition?
- How shall a procedure be interpreted when called from a certain process?
The Instance Generator
The Analyzer provides two commands to use the Instance Generator from the command line user interface. These commands are described in The Analyzer Command Line UI but are repeated here for the sake of completeness.
Set-Instance
[On/Off]This command sets an option that specifies whether an instance information file should be generated or not when the SDL system is analyzed. The option is by default off.
Instance-File
<file spec>This command sets the name of the instance information file. The default filename is <systemname>.ins, where <systemname> is the name of the analyzed SDL system.
The Instance Generator can also be started from the Analyzer's graphical user interface. This is done in a way similar to how cross reference files are generated. In the Analyze dialog in the Organizer, you can check a button to make the Analyzer call the Instance Generator when the system has been analyzed. From this dialog it is also possible to set the name of the generated instance information file.
The Instance Generator is automatically invoked to produce the information needed by tools such as the State Matrix Viewer.
File Syntax
An instance information file consists of a fileheader followed by a list of records:
<fileheader>
<record>
<record>
...
<record>The <fileheader> is a string telling which version of the Instance Generator that has generated the file. Each <record> describes an SDL entity according to the following format:
<level> <entity class> <name>
<attribute> = <value>
...
<attribute> = <value>
.The <level> is a number that tells at what depth in the "instance tree" the entity was found. For example, the system entity has level 1, a block entity in the system has level 2, a process entity in the block has level 3, and so on.
Attributes can be divided into three distinct categories depending on the format of their values:
- A single value:
<attribute> = <single value>- A list of single values:
<attribute> = (
<single value>
<single value>
...
<single value>
)- A list of pairs of single values:
<attribute> = (
<single value> <single value
<single value> <single value>
...
<single value> <single value>
)Sometimes an attribute is omitted from a record. This happens when the value of the attribute is an empty string or list.
The table below lists all entity classes for which information is generated in an instance information file. The attributes of the entities are also described, together with the category of the attributes (1, 2 or 3 according to above).
In the descriptions, the following terms are used:
- A state-containing entity is an entity that may contain states, i.e. a process, process instance, service, service instance or procedure.
- A transition initiator is an entity that can make a state-containing entity perform a transition from one state to another, i.e. a start, input, priority input, enabling condition or continuous signal.
BLOCK InstRef ConnectionOutThe names of the channels that are on the outside of this block.
ConnectionInThe names of the channels or signalroutes that are on the inside of this block.
BLOCK_INST InstRef TypeRefSDT references to block type definitions. The first reference is to the block type from which this block instance is instantiated, followed by references to its supertypes all the way to the block type on top of the inheritance hierarchy.
CALLED_ PROCEDURE InstRefAn SDT reference to the definition of this called procedure.
CHANNEL InstRef SignalSetThe signals that are conveyed on this channel in the direction from the From-entity to the To-entity. Each signal is described by its name followed by an SDT reference to the definition of the signal.
SignalSetRevAs SignalSet but for the signals that are conveyed in the opposite direction.
FromThe name of the block or block instance from which this channel starts. If the channel starts from the environment surrounding the system, system instance, block or block instance where this channel is located, this attribute is "env".
FromViaThis attribute is specified when the From-entity is a block instance, and is then the name of the gate of that block instance to which this channel is connected.
ToThe name of the block or block instance to which this channel leads. If the channel leads to the environment surrounding the system, system instance, block or block instance where this channel is located, this attribute is "env".
ToViaThis attribute is specified when the To-entity is a block instance, and is then the name of the gate of that block instance to which this channel is connected.
CHANNEL_ SUBSTRUCTURE InstRefAn SDT reference to the definition of this channel substructure.
CONTINUOUS_ SIGNAL1 InstRefAn SDT reference to the definition of this continuous signal.
InTypeThe name of the state-containing entity in which this continuous signal is defined.
OutputsThe output signals that might be sent in the transition that is initiated by this continuous signal. Each signal is described by its name followed by an SDT reference to one of the output symbols in the transition that contains that name.
CallsThe procedures that might get called in the transition that is initiated by this continuous signal. Each procedure is described by its name followed by an SDT reference to one of the symbols in the transition that contains a call to a procedure with that name. This name is also the name of a CALLED_
PROCEDURE entity that describes how the procedure look from the calling state-containing entity's point of view. This entity is normally placed immediately after the state information of the state-containing entity. However, when the state-containing entity is a procedure within another state-containing entity, it might be that the procedure has been called from another place in this surrounding state-containing entity. Then the CALLED_
PROCEDURE entity is not placed here also, since it is identical to the first one. NextStatesThe states that might become the nextstate after the transition that is initiated by this continuous signal. Each state is described by a name followed by an SDT reference to one of the state symbols that contains that name.
ENABLING_ CONDITION InstRefSee the description for CONTINUOUS_ SIGNAL.
InTypeSee the description for CONTINUOUS_ SIGNAL.
OutputsSee the description for CONTINUOUS_ SIGNAL.
CallsSee the description for CONTINUOUS_ SIGNAL.
NextStatesSee the description for CONTINUOUS_ SIGNAL.
GATE InstRef SignalSetThe signals that are conveyed through this gate in to the block instance, process instance or service instance to which the gate belongs. Each signal is described by its name followed by an SDT reference to the definition of the signal.
SignalSetRevAs SignalSet but for the signals that are conveyed in the opposite direction.
INPUT InstRefSee the description for CONTINUOUS_ SIGNAL.
InTypeSee the description for CONTINUOUS_ SIGNAL.
OutputsSee the description for CONTINUOUS_ SIGNAL.
CallsSee the description for CONTINUOUS_ SIGNAL.
NextStatesSee the description for CONTINUOUS_ SIGNAL.
PRIORITY_ INPUT InstRefSee the description for CONTINUOUS_ SIGNAL.
InTypeSee the description for CONTINUOUS_ SIGNAL.
OutputsSee the description for CONTINUOUS_ SIGNAL.
CallsSee the description for CONTINUOUS_ SIGNAL.
NextStatesSee the description for CONTINUOUS_ SIGNAL.
PROCESS InstRef IniNoOfInst MaxNoOfInstThe maximum number of dynamic instances of this process. If this attribute is omitted it means that there is no upper limit on the number of dynamic instances.
SignalSetThe signals that can be received by this process. This set of signals is commonly known as the valid input signal set of the process. Each signal is described by its name followed by an SDT reference to the definition of the signal.
ConnectionOutThe names of the signalroutes that are on the outside of this process. Naturally, this attribute is only present when the process consists of services.
ConnectionInThe names of the signalroutes that are on the inside of this process. Naturally, this attribute is only present when the process consists of services.
PROCESS_ INST InstRefAn SDT reference to the definition of this process instance.
TypeRefSDT references to process type definitions. The first reference is to the process type from which this process instance is instantiated followed by references to its supertypes all the way to the process type on top of the inheritance hierarchy.
IniNoOfInstThe initial number of dynamic instances of this process instance.
MaxNoOfInstThe maximum number of dynamic instances of this process instance. If this attribute is omitted it means that there is no upper limit on the number of dynamic instances.
SignalSetThe signals that can be received by this process instance. This set of signals is commonly known as the valid input signal set of the process instance. Each signal is described by its name followed by an SDT reference to the definition of the signal.
SAVE InstRef InTypeThe name of the state-containing entity in which this save is defined.
SERVICE InstRef SERVICE_ INST InstRefAn SDT reference to the definition of this service instance.
TypeRefSDT references to service type definitions. The first reference is to the service type from which this service instance is instantiated followed by references to its supertypes all the way to the service type on top of the inheritance hierarchy.
SIGNALROUTE InstRef SignalSetThe signals that are conveyed on this signalroute in the direction from the From-entity to the To-entity. Each signal is described by its name followed by an SDT reference to the definition of the signal.
SignalSetRevAs SignalSet but for the signals that are conveyed in the opposite direction.
FromThe name of the process, process instance, service or service instance from which this signalroute starts. If the signalroute starts from the environment surrounding the block, block instance, process or process instance where this signalroute is located, this attribute is "env".
FromViaThis attribute is specified when the From-entity is a process instance or a service instance, and is then the name of the gate of that process instance or service instance to which this signalroute is connected.
ToThe name of the process, process instance, service or service instance to which this signalroute leads. If the signalroute leads to the environment surrounding the block, block instance, process or process instance where this signalroute is located, this attribute is "env".
ToViaThis attribute is specified when the To-entity is a process instance or a service instance, and is then the name of the gate of that process instance or service instance to which this signalroute is connected.
START2 InstRefSee the description for CONTINUOUS_ SIGNAL.
InTypeSee the description for CONTINUOUS_ SIGNAL.
OutputsSee the description for CONTINUOUS_ SIGNAL.
CallsSee the description for CONTINUOUS_ SIGNAL.
NextStatesSee the description for CONTINUOUS_ SIGNAL.
STATE InstRefSDT references to the state symbols in the state-containing entity that contain the name of this state. If the state-containing entity is a process type, service type or procedure, occurrences in the supertypes are also included.
SUBSTRUCTURE ConnectionOutThe names of the channels that are on the outside of this substructure.
ConnectionInThe names of the channels or signalroutes that are on the inside of this substructure.
SYSTEM InstRef SYSTEM_INST InstRef TypeRefSDT references to system type definitions. The first reference is to the system type from which this system instance is instantiated followed by references to its supertypes all the way to the system type on top of the inheritance hierarchy.
1 The name of a CONTINUOUS_SIGNAL entity is set to the priority of the continuous signal. If no priority has been specified, maximum priority is assumed and the name is then set to "MAX_PRIO".
2Information about the entities is generated in pre-order (prefix walk in the instance tree). This means that an entity is always followed by the entities defined within itself.
A formal and complete description of the general format of an instance information file would be rather complex, and is beyond the scope of this text. Instead, see Example 350:
Example 350 : An instance information file
Consider the SDL system below:
System ExSystem;Signal Sig(Integer), Inp;channel ExChannelfrom ExBlock to env with Sig;from env to ExBlock with Inp;endchannel ExChannel;block ExBlock referenced;endsystem ExSystem;Block ExBlock;signalroute ExSignalRoutefrom ExProcess to env with Sig;from env to ExProcess with Inp;process ExProcess referenced;connect ExChannel and ExSignalRoute;endblock ExBlock;Process ExProcess;DCL Counter Integer;procedure ExProcedure referenced;start ;task Counter := 0;grst4:nextstate Wait;state Wait;input Inp;task {Counter := call ExProcedure(Counter);};output Sig(Counter);join grst4;endstate;endprocess ExProcess;Procedure ExProcedure;FPAR a Integer;RETURNS ret Integer;start ;nextstate Idle;state Idle;input *;task {ret := a+1;};return ;endstate;endprocedure ExProcedure;The instance information file for this SDL system will look like this:
SDTINST V1.01 SYSTEM ExSystemInstRef = #SDTREF(TEXT,ExSystem.pr,1).2 CHANNEL ExChannelInstRef = #SDTREF(TEXT,ExSystem.pr,3)SignalSet = (Sig #SDTREF(TEXT,ExSystem.pr,2))SignalSetRev = (Inp #SDTREF(TEXT,ExSystem.pr,2))From = ExBlockTo = env.2 BLOCK ExBlockInstRef = #SDTREF(TEXT,ExSystem.pr,10)ConnectionOut = (ExChannel)ConnectionIn = (ExSignalRoute).3 SIGNALROUTE ExSignalRouteInstRef = #SDTREF(TEXT,ExSystem.pr,11)SignalSet = (Sig #SDTREF(TEXT,ExSystem.pr,2))SignalSetRev = (Inp #SDTREF(TEXT,ExSystem.pr,2))From = ExProcessTo = env.3 PROCESS ExProcessInstRef = #SDTREF(TEXT,ExSystem.pr,18)IniNoOfInst = 1SignalSet = (Inp #SDTREF(TEXT,ExSystem.pr,2)).4 START StartInstRef = #SDTREF(TEXT,ExSystem.pr,21)InType = ExProcessNextstates = (Wait #SDTREF(TEXT,ExSystem.pr,24)).4 STATE WaitInstRef = (#SDTREF(TEXT,ExSystem.pr,25)).5 INPUT InpInstRef = #SDTREF(TEXT,ExSystem.pr,26)InType = ExProcessOutputs = (Sig #SDTREF(TEXT,ExSystem.pr,30))Calls = (ExProcedure #SDTREF(TEXT,ExSystem.pr,28))Nextstates = (Wait #SDTREF(TEXT,ExSystem.pr,24)).4 CALLED_PROCEDURE ExProcedureInstRef = #SDTREF(TEXT,ExSystem.pr,20).5 START StartInstRef = #SDTREF(TEXT,ExSystem.pr,36)InType = ExProcedureNextstates = (Idle #SDTREF(TEXT,ExSystem.pr,37)).5 STATE IdleInstRef = (#SDTREF(TEXT,ExSystem.pr,38)).6 INPUT InpInstRef = #SDTREF(TEXT,ExSystem.pr,39)InType = ExProcedureNextstates = (return #SDTREF(TEXT,ExSystem.pr,43)).
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |