Please review any and all PUBLIC repositories, groups and associate files. These allow anyone on the Internet to access without authentication. Repository and group owners are responsible for their content and permission settings. Go to your project(s), click on Settings > General and expand the "Visibility, project features, permissions" to change this setting.

Document the Trace Generator script

parent c8ff00bc
# Monterey Phoenix - Trace Generator
## Setup/Requirements
* C++ compiler
* Bash compatible command line
## Running Event Generator
## How to Run Trace Generator
The event generator can be run using the rall.sh script in the build folder:
```bash
./Code/rall.sh [mp_filepath] [scope]
......@@ -12,9 +12,40 @@ The event generator can be run using the rall.sh script in the build folder:
- mp_filepath should be the location of the MP file that you want to process
- scope is the number of repetitions, use higher values with caution
There are example MP files in the Firebird_Pre_loaded_examples folder. To build those files, run the following command:
There are example MP files in the Firebird_Pre_loaded_examples folder. To build those files, run a command like this:
```bash
./Code/rall.sh ./Firebird_Pre_loaded_examples/Example01_simple_message_flow.mp 1
```
The output will be saved to Example01_simple_message_flow.json
\ No newline at end of file
The event generator results will be saved in the output folder as a json file with the same name as the input MP filename.
## Overview
The Trace Generator uses Rigal to convert the MP file rules into C++ code which is then executed to generate the JSON output. The "rc" command runs the Rigal compiler and generates the .rsc tree. The "ic" command runs the Rigal interpreter which converts the tree into C code. Here is the step by step process
1. Compile the MP2-parser.rig
- Creates **MP2-parser.rsc** which is the compiled Rigal code
- Creates **xd** script which will be used to cleanup the results
2. Run the interpreter on the MP2-parser.rsc with the inputs from the user MP file and scope.
- Creates **tree** file
- Output on this interpreter is redirected by the script to **temp.out**. So any program output and errors will be found there.
3. Compile the MP2-generator.rig
- Creates **MP2-generator.rsc** which is the compiled Rigal code
4. Run the interpreter on the MP2-generator.rsc with the **tree** input from the previous interpreter
- Creates **{Your MP file}.cpp**
- Output on this interpreter is redirected by the script to **temp2.out**. So any program output and errors will be found there.
5. Run the C++ compiler on **{Your MP file}.cpp**
- Creates **{Your MP file}** compiled C++
6. Run the compiled C++ program
- Creates **{Your MP file}.json**
- Output on this program is redirected by the script to **{Your MP file}.txt**. So any MP output and errors will be found there.
For the detailed documentation about how the MP parser works, look at the [Documentation/MP_implementation_notes.pdf](Documentation/MP_implementation_notes.pdf).
## Documentation
* [User Documentation on Wiki](https://wiki.nps.edu/display/MP/Monterey+Phoenix+Home)
* [Documentation/MP_implementation_notes.pdf](Documentation/MP_implementation_notes.pdf) - Detailed overview of how the original script for running the Trace Generator works
* [Documentation/MP-syntax-v4.pdf](Documentation/MP-syntax-v4.pdf) - MP Language Manual
* RIGAL programming language
* [Documentation/JSON_file_structure.pdf](Documentation/JSON_file_structure.pdf)
- [RIGAL/p61-auguston.pdf](RIGAL/p61-auguston.pdf)
- [RIGAL/Rigal_LNCS-1991.pdf](RIGAL/Rigal_LNCS-1991.pdf)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment