Reactis Simulator#
What is Reactis Simulator?#
Reactis Simulator enables users to visualize execution of Simulink/Stateflow models. Simulator’s user interface is similar to those of traditional debuggers from programming languages: it enables users to execute their models step-by-step (or even block-by-block), as well as set breakpoints. Simulator can also:
step backwards through a simulation
enable controlled replay of tests generated by Reactis Tester
present a graphical display of different coverage criteria
fine-tune Tester-generated test suites.
How do I start Reactis Simulator?#
Load your model in Reactis and then click the green button in the tool bar.
When I start Simulator on a large model it can take a while to start up. Is this to be expected?#
Simulator startup consists of three phases: Model import, type inference and initialization. Model import and type inference may take a significant amount of time for large models. Watch the bottom left corner of the Reactis Window for status messages during Simulator startup. If caching is enabled for a model, the imported model will be stored in a file (with a .mwi or .mwib suffix) which means that import can be skipped on subsequent invocations (if no modifications were made to the model).
How can I view the current values of data items during a simulation run?#
For any data item (Simulink block, signal, Stateflow variable, C variable if using the Reactis for C Plugin, or Embedded MATLAB variable if using the Reactis for EML Plugin), at any point during a simulation run, you can:
Hover over the data item in the diagram window. This will cause a pop-up to display the current value of the item.
Right-click on the data item and select Open Scope which will open a graph displaying the value.
Right-click on the data item and select Add to Watched which will display in a table in the lower part of the simulator window.
How do I determine which parts of a model are not exercised by a test suite?#
This can be done as follows:
Load your model in Reactis.
Start Simulator (click the green button in the tool bar).
Load the test suite by selecting menu item Test Suite > Open…
Ensure menu item Coverage > Show Details is selected. Unexercised portions of the model will be highlighted in red. Since no simulation steps have occurred yet, all targets will be red.
In the steps to pause entry box in the tool bar (the entry box that contains a number), enter 0. This is a shorthand to indicate that the entire test suite should execute.
Click the fast simulation button (>>) to execute all tests.
Upon completion only parts of the model not exercised by the tests will be highlighted in red.
Alternatively, you could generate a test execution report as follows:
Load your model in Reactis.
Start Simulator (click the green button in the tool bar).
Load the test suite by selecting menu item Test Suite > Open…
Select Simulate > Fast Run with Report…
In the launch dialog you can configure the report that will be produced after running the test suite. You can specify that this report include two types of coverage mappings:
map each coverage target to the test/step in which it is first covered, and/or
map each step in the test suite to the list of targets it covers for the first time.
In addition to coverage information you can also include signal plots in the report.
How do I set a breakpoint?#
Right-click on a Simulink block, Stateflow state, Stateflow transition, C source line, or Embedded MATLAB source line in the main panel and select Toggle Breakpoint. You can also right-click on a Simulink or Stateflow block in the model hierarchy display panel of the main Reactis window and select Toggle Breakpoint.
Why is there a blue rectangle in the main Reactis panel?#
This rectangle appears when a region has been selected for printing (this is done in the main Reactis panel by holding down the CTRL key, left-clicking and dragging). To remove the rectangle, select menu item File > Remove Print Region, or press the Escape (ESC) key.
I created a test suite from a model using Reactis, but when I run the tests within Reactis, the output values are different than those stored in the tests. Why is this?#
The probable explanation is that your model was modified after the tests were generated, but before they were run. In this case, feeding in the input values from the test might yield different responses from the model. To update a test suite so that the new model responses are recorded in the tests, load the model and test suite in Simulator and then select Test Suite > Update Outputs…
Another possible explanation for the differences is that the model contains an S-function that maintains its own state from one call to the next. (For example, the S-function might modify global or statically allocated variables.) During the test-generation process Reactis repeatedly restarts simulations from intermediate model configurations. In order to restore configurations for S-functions appropriately, Reactis must be able to extract any persistent state information the function might have. Reactis can do this if the S- function adheres to the constraints described in Chapter Preparing Models for Use with Reactis of the Reactis User’s Guide and only uses storage allocated by mdlInitializeSizes() to store information between calls to the S-function.