Slow simulation in mixed language mode

Category |  Purpose |  Intended Audience |  Applicable to |  Description |  Limitations |  See also


Category:

Top

Toolset


Purpose:

Top

To make users aware of the speed limitations when using mixed language models in SimulationRTS


Intended Audience:

Top

All ObjecTime developers using mixed RPL/C++ models


Applicable to:

Top

All Versions


Description:

Top

If you started out with just RPL actors in your model and are gradually converting actors to C++, you will likely experience a slowdown in the SimulationRTS.

The slowdown is due to the way that C++ actors work in the SimulationRTS. Any model with C++ actors will probably be slower in Simulation than an RPL-only model, particularly if there is a lot of messaging. The C++ SimulationRTS is really just a framework that holds the user-defined C++ code. All RTS services are actually performed by the toolset. The toolset has a representation of the complete model within it, and the real RTS with message queues, etc. is in the toolset. The C++ code is run as a separate process which simply sends all its requests to the toolset. Any messages sent or received by the C++ side must be encoded, packetized and sent over a socket to the toolset to be placed in the message queues. So, even if communication is occuring directly between two C++ actors, the message will have to be routed through the toolset. This, of course, greatly impacts the processing speed. RPL actors will execute faster, in general, than C++ actors in the SimulationRTS.

If speed is a major factor in your tests, you may want to run the C++ portion of your model in the TargetRTS, which is, of course, much faster. You could make the connection between your RPL portions (such as test drivers) and the C++ portions under test using layer connections (SAP/SPP), and then move the C++ portions under test to the TargetRTS, and have your RPL actors connect with the TargetRTS system through the external layer service. Of course, you will lose the graphical observability this way (unless you are using the Target Observability feature in 5.0).


Limitations:

Top

When converting RPL actors to C++, users must be aware of the differences between RPL and C++, and must visit the translated code (if using the RPL->C++ translator) and modify it to ensure correct C++ syntax is used. Also, when converting classes to run in the TargetRTS, users must be aware of differences between SimulationRTS and the TargetRTS. Contact ObjecTime Support for more information about any of these topics.


See also:

Top

RPL Guide, C++ Guide


 

Copyright © 1999, ObjecTime Limited.