This document describes how a Finite Message Machine (FMM) or a System Support Machine (SSM) is structured using the Multiple Problem Oriented Language (MULTIPOL) and its subsets. These subsets, and other related definitions and terms applicable to FMM and SSM skeletons are dicussed in the following clauses.
When stucturing an FMM or SSM MULTIPOL is used, together with CHILL. Within MULTIPOL are the subset languages described in the following subclauses.
This provides a uniform structure for the System 12 CHILL programs. It identifies to the MULTIPOL preprocessor the descriptor name for the particular program. The descriptor is used by the preprocessor to access the software Components Libary so that details on the interface used for the program are obtained. As a result, the preprocessor is able to access the Meta Database (MDB) and generate appropriate CHILL statements, for all modes and declarations to support communications via messages to other support machines (FMMs or SSMs).
The use of PSL enables FMMs or SSMs to be stuctured within a defined framework. Basic skeletons that define the framework are available for FFMs and SSMs. The terms FMM skeleton and SSM skeleton apply primarily to to the basic skeletons described in Clauses 3 and 4. The source code for an FMM or SSM is normally arranged in single parent file. If Assembly Language is used to stucture part or all of the FMM or SSM, the source code may be divided into more than one file. However, most FMMs or SSMs will be coded in MULTIPOL and are structured as shown in the following text. FMMS and SSMs are treated in the same way by the MULTIPOL preprocessor Figure 1 shows a simplified sequence of events in the production of an exchange load tape from a MULTIPOL source file.
The MULTIPOL language includes certain CHILL statements for which the MULTIPOL preprocessor does contents checks before passing them to the CHILL compiler. The remaining CHILL statements (which, in a typical FMM comprise most of the code) are passed to the compiler, unprocessed.
This language is used to support uniform data requests to the MDB during MULTIPOL preprocessing. The MDB forms part of the Software Development Support System (SDSS) for a System 12 exchange. It provides the Data Base Administrator (DBA) with the means for insertion, modification and deletion of data model definitions in the MDB in response to user requests for data structures or as part of the DBA managment function.
----------------------- | MULTLPOL PROGRAM | | | | FOR | | CHILL | | FMM or SSM | ----------------------- | | MULTIPOL SOURCE | ---------------- MDB ------------------------| MULTIPOL | (STANDARD DATA DEFINITIONS) | | SCDL------------------------| PREPROCESSOR | (MESSAGE DEFINITIONS) ---------------- | | CHILL SOURCE ---------------- | CHILL | | COMPILER | ---------------- ASM MODULES (IF ANY) | RELOCATABLE BINARY CODE | | | ---------------- | | LINKAGE | |--------| EDITOR | ---------------- | OPERATING SYSTEM ROUTINES | GSM OTHER FMMs or SSMs AND SSM ---------------- | | | SEGMENT | | |------------------| |----------------| | MAPPER | ---------------- | | GLS | ---------------- | SYSTEM | | BUILDER | ---------------- | | | EXCHANGE LOAD TAPE |
The access rights model and the data submodel definition for the program, are accessed in the MDB to verify that data requests in DML are valid. If a data request is valid, the correct CHILL statements are generated. These statements include calls to the Database Management System, which, at run time, will execute the required data manipulation in the System 12 data base for the related processor.
This language is used to access operating system functions for message handling. When an OSNL statement is encountered by the MULTIPOL preprocessor, the Software Components Description Libary (SCDL) descriptor is checked. If the request is valid for the message identified, the necessary CHILL statements are generated including call statements to the Operating System Nucleus (OSN) procedures.
Because FMM and SSM skeletons both use PSL, there are a number of common features. These are described in the following subclauses.
In both skeletons, there is a statement that identifies the descriptor to be used for the FMM or SSM. This statement includes the Partitioned Data Set (PDS) member name in the following format:
IIIIVVXX
The IIII characters are replaced with the base 20 four-letter equivalent of the number of the descriptor. When a skeleton is complete, this is replaced by the appropriate base 20 number but with the Product Change Status field set to joker characters XX. An example of how a number is converted is shown below:
By using the following table the base 20 number is then translated to become FPQB.
0 - A | 5 - G | 10 - M | 15 - S |
1 - B | 6 - H | 11 - N | 16 - T |
2 - C | 7 - J | 12 - P | 17 - V |
3 - D | 8 - K | 13 - Q | 18 - W |
4 - F | 9 - L | 14 - R | 19 - Y |
FMMs and SSMs both contain identifiers that are in accordance with the Software Development Rules. The following constraints apply to the use of identifier names:
Many of the identifiers used must include the identity of the source file in which they are declared. The characters IIII are used in this document to represent the file identity. In each case, the IIII characters are replaced by the base 20 four-letter equivalent of the source file number.
All identifiers normally end with a descriptive name that is preceded by an underscore but in some cases this is optional. In this document, this descriptive name is represented by "name". An example is where the application module of an FMM has in the skeleton, the identifier, H_A_IIII_name. If the source file has the number 211 12345 PQRS this number will become H_A_BMVG_name in the coded FMM.
Access to the data base from an FMM or an SSM is by the Data Manipulation language (DML). To gain access, a Data Sub Model Definition (DSMD) is invoked by a DML command in the following format:
INVOKE DSMD Y_name
The data relations listed in the DSMD can then be manipulated using the DML primitivies. An alternative version of the INVOKE command is:
INVOKE RELATION (< relation name list >);
This version lists directly the data relations to which access is required.
To access data modes or synonyms that are defined in the data base, two further types of the INVOKE command are used:
INVOKE MODE (< mode list >); INVOKE SYNONYM (< synonym list >);
These commands give the name of the mode or synonym to which access is required.
Figure 2 shows the basic structure of an FMM and the types of CHILL and POL statements allowed at various points within the PSL framework. Upper case characters are used for PSL statements, and for CHILL and MULTIPOL key words. Lower case characters are used for such items as labels, which are used within the FMM where needed. Each skeleton has the following elements, some of which are not shown in the figure.
DEFINE_FMM USING DESCRIPTOR IIIIVVXX; app_mod: APPLICATION_MODULE; |----------------- CHILL and POL | NEWMODE statements | SYNMODE allowed | INVOKE mode | INVOKE synonym | SEIZE | SYN | INCLUDE |----------------- app_proc: APPLICATlON_PROCESS |----------------- CHILL and POL | Any CHILL statements | Any DML allowed | Any OSNL | (but not WAIT_CASE | for basic messages) |----------------- END app_proc; END app_mod; sup_mod: SUPERVISOR_MODULE; |----------------- CHILL and POL | NEWMODE statement | SYMODE allowed | INVOKE mode | INVOKE synonym | SEIZE | SYN | INCLUDE | DCL |----------------- sup_proc: SUPERVISOR_PROCESS; |----------------- CHILL and POL | Any CHILL statements | Any DML allowed | Any OSNL |----------------- END sup_proc; |----------------- CHILL and POL | statements | GRANT allowed | |----------------- END sup_mode; END_FMM; |
DEFINE_FMM USING DESCRIPTOR IIIIVVXX;The descriptor is decribed in Subclause 2.5.1.
H_A_IIII_name: APPLICATION_MODULE;
G_A_IIII_name: APPLICATION_PROCESS;The label G_A_IIII_name, is the same as the
END G_A_IIII_name; END H_A_IIII_name;
H_S_IIII_name: SUPERVISOR_MODULE;
G_S_IIII_name: SUPERVISOR_PROCESS;The label, G_S_IIII_name, is the same as the < CHILL identifier> used in the supervisor statement in the FMM descriptor.
END G_S_IIII_name; END H_S_IIII_name;
END_FMM.
Data area A defines data for the application part only and is replicated for each instance of the applications process. There is only one copy of data area B, which defines data for the supervisor part of the skeleton.
Each data area may have CHILL declarations for local data and, if required, a DML INVOKE statement which allows access to the data base.
Figure 3 shows the basic structure of an SSM and Figure 4 shows its constituent parts. The figures also show the type of CHILL and POL statements allowed at various points in the PSL framework. Upper case characters are used for PSL statements and for CHILL and MULTIPOL keywords. Lower case characters are used for such items as labels which are used within the SSM as needed. Each skeleton has the following elements, some of which are not shown in the figure.
DEFINE_SSM USING DESCRIPTOR IIIIVVXX; ssm_reg: SSM_REGION; |---------------------- CHILL and POL | NEWMODE statements | SYNMODE allowed | INVOKE mode | INVOKE synonym | SEIZE | GRANT | SYN | INCLUDE | DCL | CLOCKED_PROC | INTERRUPT_PROC | EVENT_HANDLER |---------------------- END ssm_reg; ssm_mod: SSM_MODULE; |---------------------- CHILL and POL | NEWMODE statements | SYNMODE allowed | INVOKE mode | INVOKE synonym | SEIZE | GRANT | SYN | INCLUDE | DCL | CLOCKED_PROC | INTERRUPT_PROC | EVENT_HANDLER | INTERFACE_PROC |---------------------- END ssm_mod; END_SSM; |
Clocked Procedure Framework
proc_name: CLOCKED_PROC (); |--------------------- CHILL and POL | Any CHILL statement statements allowed | TRANSMIT_BASIC_MSG | OR | TRANSMIT_DIRECTED_MSG |--------------------- END proc_name:NOTE: Certain other OSNL statements are also allowed in a clocked procedure. Interupt Procedure Framework proc_name: INTERRUPT_PROC (); |--------------------- CHILL and POL | Any CHILL statement statements allowed | TRANSMIT_BASIC_MSG | OR | TRANSMIT_DIRECTED_MSG |--------------------- END proc_name:NOTE: Certain other OSNL statements are also allowed in a clocked procedure. Interface Procedure Framework proc_name: INTERFACE_PROC (< parameters >) RETURNS (< mode >); |--------------------- CHILL and POL | Any CHILL statements | Any DML allowed | Any OSNL | (but no WAIT_CASE | for basic messages) |--------------------- END proc_name:Event Handler Framework proc_name: EVENT_HANDLER (); |--------------------- CHILL and POL | Any CHILL statement statements allowed | TRANSMIT_BASIC_MSG | OR | TRANSMIT_DIRECTED_MSG |--------------------- END proc_name:NOTE: Certain other OSNL statements are also allowed in an event handler. |
DEFINE_SSM USING DESCRIPTOR IIIIVVXXThe descriptor is described in Subclause 2.5.1.
H_R+IIII_name: SSM_REGION
DCL T_MSG_BUF PTR;
P_IIII_name: EVENT_HANDLER (); P_IIII_name: INTERRUPT_PROC ();or
P_IIII_name: CLOCKED_PROC ();The statement is followed by the procedure body. The procedure finishes with the statement
END P_IIII_name;In the procedure name, the IIII characters are replaced with the four-letter equivalent of the number of the SSM, as described earlier. The name is unique to the procedure and remains unchanged. The following fact should be noted.
END H_M_IIII_name;
H_M_IIII_name: SSM_MODULE
DCL T_MSG_BUF PTR;
P_IIII_name: INTERFACE_PROC (< parameters >) RETURNS_ (< modes>);or
P_IIII_name: CLOCKED_PROC ();or
P_IIII_name: EVENT_HANDLER ();or
P_IIII_name: INTERRUPT_PROC ();Where < parameters > is replaced with a formal parameter List in normal CHILL syntax. Sometimes the formal parameter list may be empty. RETURNS (< mode >) is the CHILL result mode specification, and is required if the procedure in a function is returning a value. If the procedure is not returning a value, it is sometimes omitted. Each procedure finishes with the following statement.
END P_IIII_nameIn the procedure name the IIII characters are replaced with the four-letter equivalent of the number of the SSM, as described previously. The name is unique to the procedure and remains unchanged.
END H_M_IIII_name;
END_SSM;
In the source code for FMMs and SSMs, provision has been made for incorporating definitions from linkages to other software items. Particular instances are message definitions and Operating System Nucleus (OSN) primitives. Explicit statements are required at the positions defined in Clauses 3 (4), 3 (5), 4 (4), and 4 (5) for the application and supervision parts of an FMM and the CHILL REGION and CHILL MODULE of an SSM.
When required, connections are provided to some or all of the following:
SEIZE OSN-primitive <> NON-LINKED (NN, MM) (< parameter List >) [RETURNS (< result mode >)];Where NN is the procedure type and MM is procedure number. These primitives can also be incorporated by INCLUDE statements for one or more members containing such SEIZE statements.
SEIZE Q_KKLY_INPUT <> ASM ()or
SEIZE DB_DAREQ_ <> NON_LINKED () (M_DB_PARMS LOC);or
SEIZE INTF_TICP03_1 <> NON_LINKED () (INT, BOOL, CHAR (8), LOC, MORE_NAME)
Several methods for the structure of an FMM are possible. For example a hierarchical structure of nested loops and IF statements or a Finite State Machine (FSM) based on a CASE statement. The following subclauses, describe three models and some of the corresponding coding. The choice of code structure depends on the functions to be performed by the particular FMM.
This model is used both for the supervisor and application parts of an FMM. It conforms to the classic concepts of structured programming, where part of an FMM is built up from simple statements and the IF, DO, CASE and WAIT_CASE constructs. These can follow each other in sequence and can also be nested within one another.
This model is uses the variable STATE, the value of which is tested by a CASE statement within an everlasting loop. Each CASE alternative is a WAIT_CASE statement and receives the messages that are to be handled for the corresponding value of STATE. The WAIT_CASE clause for each message contains CHILL and POL code, as required to handle the message and concludes with a statement that sets STATE to the next value.
Both the supervisor part and application part of an FMM can be coded in this way, although it is more suited to the application part of the FMM. In either part, the local data declarations include a declaration of the STATE variable in the form shown below:
NEWMODE Z_STATE_MODE = SETS (S_101 IDLE,....); DCL STATE Z_STATE_MODE;
Figure 5 shows the code for the main part of the supervisor or application process. Local procedures are incorporated as required.
STATE:= S_010_IDLE; /*PUT TO IDLE AT PROCESS START*/ FSM: DO FOR EVER; CASE STATE OF /****************************************/ /* STATE HEADER */ /* */ /* NAME: S_010_IDLE */ /* FUNCTION: */ /* */ /****************************************/ (S_010_IDLE): L_010_IDLE: WAIT CASE; MMM1_MSGNAME (Z_PAR1,....): /* MMM1_MESSAGE ROUTING NUMBER */ /* MSGNAME-ABBREVIATED MESSAGE NAME IN LIBRARY*/ |
In this method, the supervisor or applications part of the FMM, at the outer level, comprises a WAIT_CASE statement for all messages that are received by the FMM part. Again, within each WAIT_CASE clause, the variable STATE is tested, usually by a CASE statement. The statements are executed according to the value of the STATE variable and finish with a statement that sets the STATE variable to the next state value.
This model, although similar to the state-based FSM model, differs in one respect - each message is handled explicitly as it is received. Because messages are not deferred, it is easier to take action for messages received out of sequence.
Конвертация в HTML Максим Осташов Размещено на www.s12most.mailru.com 27 ноября 2001 |