The Cosimulation Environment

The Link for ModelSim is a client/server test bench and cosimulation application. The role that ModelSim plays in a Link for ModelSim simulation environment depends on whether ModelSim links to MATLAB or Simulink.

MATLAB and ModelSim Links

When linked with MATLAB, ModelSim functions as the client, as the following figure shows.

In this scenario, a MATLAB server function waits for service requests that it receives from a ModelSim simulator session. After receiving a request, the server establishes a communication link, and invokes a specified MATLAB function wrapper that computes data for, verifies, or visualizes the HDL model that is under simulation in ModelSim.

The following figure shows how a MATLAB function wraps around and communicates with ModelSim during a test bench simulation session.

The MATLAB server can service multiple simultaneous ModelSim sessions and HDL entities. However, you should adhere to recommended guidelines to ensure the server can track the I/O associated with each entity and session. The following figure shows a multiple-client scenario connecting to the server at TCP/IP socket port 4449.

Simulink and ModelSim Links

When linked with Simulink, ModelSim functions as the server, as shown in the following figure.

In this case, ModelSim responds to simulation requests it receives from cosimulation blocks in a Simulink model. You initiate a cosimulation session from Simulink. Once a session is started, you can use Simulink and ModelSim to monitor simulation progress and results. For example, you might add signals to a ModelSim Wave window to monitor simulation timing diagrams.

As the following figure shows, multiple cosimulation blocks in a Simulink model can request the service of multiple instances of ModelSim, using unique TCP/IP socket ports.


Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS