mast


SIM_MAST:

Simulator of MAST Models


Objectives
use cases
Components
Profiles
Restrictions




Sim_Mast is a tool that executes the simulation process of a MAST model, generating information about:

      - The fulfillment of the timing requirements set in the model.
- The temporal behavior of the model in the worst, the best and the average case.
- The utilization of active and passive resources.
- The execution traces.


Objectives

   The simulator has been developed with the following objectives:
- Estimating the behavior of the modeled system when there is no alternative analytic analysis tool.
- Evaluating the correctness and efficiency of other design and analysis methods and tools.
- Help in identifying bugs and bottleneck points in different stages of the developing process. 

Use Cases

     The tool has two users:

                                                   usecase

-  The designer, who needs to know the response of a system whose temporal behavior has been previously modeled with  Mast. The designer will need to execute the simulation of the model and then view the results of that execution.

-  Automatic Tools destined to implement design processes or evaluation of other analysis tools. In this case, the simulation execution will be iteratively invoked over a set of models generated by the tool.        


Components

 The tool is provided as a set of four executable programs:
- Sim_Mast_Launcher: An easy GUI application that allows to invoke the simulator, by choosing the execution parameters that are to be used.
- Sim_Mast_Simulator: The program that executes the simulation of the model.
- Mast_Results_Viewer:  GUI graphic tool for viewing the simulation results.
- Mast_Traces_Displayer:  GUI graphic tool for viewing the simulation traces.


esquema


User interface

The  Sim_Mast_Launcher module is a GUI program that allows the selection of  the Mast model that is going to be analyzed, the assignment of the simulation parameters and then, the invocation of the simulation tools.

The user interface is based on a graphic window, which contains the following controls for defining the elements needed for the simulation:
Directory: Text box that defines the directory used to create the Model file's pathname, which is also used to place the output files.

Model File: Text box that defines the name of the Mast Model file used as input for the simulator. The complete input file pathname is the concatenation of the Directory and Model File entries in the way: <Directory>+"\"+<Model File>. For the example in the next figure, it would be: “C:\Temp\Teleoperated.txt”.

Results File: Text box that defines the name of the output files generated by the simulator. The complete output files pathname is the concatenation of the Directory and Results File entries with the appropriate suffix, according to the kind of results, in the way: < Directory>+"\"+<Results File>+{”.res”|”.log”|”.bak”}. The suffix ".res" is used for the simulation results file, ".log" is used for the traces file and the ".bak" file keeps a copy of the simulated model. For the example in the next figure, the results file name would be: "C:\Temp\Teleoperated_1.res".

Time: Text box that defines the maximum simulation time, at which the simulation execution finishes. In some profiles it represents the simulation time, in others it is a timeout used to terminate the simulation when the ordinary finalizing criterion is not satisfied.

Profile: Label that specifies the results profile used in the simulation. The possible values are:            
SCHEDULABILITY, VERIFICATION, EXHAUSTIVE.

Buffer: It defines the buffer length, in bytes, of the logger used. In the case that the buffer is managed in a bounded or circular way, it is the buffer size, though if it is unbounded, it represents the size of the blocks used to storage them. It can take the values: 512, 2K, 8K y 32K.

Executions: It is used as a finalizing criterion in some profiles, the execution finishes when every transaction has been simulated at least the number of times specified.

Model: Button that launches a dialog box that helps to select the Directory and Model file to be used.

Default: Button that set the default output root file name, this is the model file name followed by an underscore and a number, that is: <Model File>+’_’+<n>’. The number increases to avoid loosing previous results.

From: Button that establishes as Model File the ".bak"  file associated to the file in the Results File entry. This button is disabled when a results file name is established and the corresponding ".bak" file does not exist.

Edit model: Button that launches the model file editor (this program is under development). This editor handles model files with the extensions {`.mdl’|’.bak’| ’.txt’}, and always saves them with the ’.mdl’ extension.

Execute: Button that executes the Model File simulation. It is enabled only if the file extension is ´.mdl` or ´.txt`.

View Results: Button that launches the results viewer.

Display Traces: Button that launches the traces viewer. It is enabled only if the results file with ’.log’ extension exists.

Exit: Button that finishes the program.

Help: Button that launches an html browser with a help page showing information about the use of this program (this page).


               sim_mast_screen



Profiles

    A profile establishes the objective of the model simulation. It defines:

- The statistical magnitudes that are to be evaluated.
- The logging messages and traces that are to be generated.
- The buffer managing mode.
- The criterion for ending the simulation.

SCHEDULABILITY_PROFILE: It generates information equivalent to that generated by the schedulability analysis tool.

   -   Monitoring:
o       Events that has Timing Requirements associated and events that are the output of a segment.
o       Events which represent the end of transactions.      
o       The utilization of resources.

-       Logging:

o       Messages that are generated when a Timing Requirement is not fulfilled.

-       Buffer Managing:

o       BOUNDED mode.

-       Ending criterion:

o     It ends when the terminal events of every transaction have been reached at least a minimum number of times, or by timeout, when the maximum simulation time is elapsed.

VERIFICATION_PROFILE: Its objective is searching for situations in which the timing requirements are not fulfilled.

- Monitoring:

o   Events that has Timing Requirements associated and events that are the output of a segment.
o   The utilization of resources.

- Logging:

o   Messages that are generated each time a relevant event (Flow_Event) occurs.
o   Messages that are generated when a Timing Requirement is not fulfilled.

- Buffer Managing:

o CIRCULAR mode.

- Finalizing criterion:

 o It ends when the terminal events of every transaction have been reached at least a minimum number of times, or by timeout, when the maximum simulation time is elapsed , or when a Timing Requirement is not satisfied.


EXHAUSTIVE_PROFILE
:  It generates an exhaustive information about the simulation's execution.

- Monitoring:
o Events that has Timing Requirements associated and events that are the output of a segment.
o The utilization of resources.
- Logging:

o Messages are generated when a Timing Requirement is exceeded.
o
Messages are generated each time an event is sent.
o
Messages are generated for each  Processing Resources, Shared_Resources ,Scheduling_Server, timers and
   activities state change.
- Buffer Managing:
o UNBOUNDED mode.
- Finalizing criterion
o It ends when the maximum simulation time is reached.

Restrictions

 A Mast Model must satisfy the following restrictions in order to be able to be simulated with Sim_Mast:
-   Networks can not operate in full-duplex transmission mode.
-  Networks can not have Character Packet Drivers.
-  The output events of a Query_Server only must be sent to activity inputs.
-  Every Activity whose operation represent the sending of a message through a network, must have an exclusive scheduling server and must be placed between two activities.
-  The operation that represents a message sent through a network has to be a Simple_operation.
-  The Avg_Interarrival value of external events must not be 0 (the default value in MAST is 0).
-  It can not be two drivers with the same Packet_Server name.