Set Up MATLAB-HDL Simulator Connection
Start MATLAB Server
Start the MATLAB® server as follows:
In the MATLAB Command Window, call the
hdldaemonfunction with property name/property value pairs that specify whether the HDL Verifier™ software is to perform the following tasks:
Use shared memory or TCP/IP socket communication
Return time values in seconds or as 64-bit integers
documentation for when and how to specify property name/property value
pairs and for more examples of using
The communication mode that you specify (shared memory or TCP/IP
sockets) must match what you specify for the communication mode when
you initialize the HDL simulator for use with a MATLAB cosimulation
session using the
In addition, if you specify TCP/IP socket mode, the socket port that
you specify with
match. See TCP/IP Socket Ports for more information .
The MATLAB server can service multiple simultaneous HDL simulator modules and clients. However, your code must track the I/O associated with each entity or client.
You cannot begin an HDL Verifier transaction between MATLAB and the HDL simulator from MATLAB. The MATLAB server simply responds to function call requests that it receives from the HDL simulator.
This command sets up socket communication on port 4449, and specifies a 64-bit time resolution format for the MATLAB function's output ports.
Start HDL Simulator
Start the HDL simulator directly from MATLAB by calling
the HDL Verifier function
You must make sure the HDL simulator executables — also
vsim (ModelSim®) and
nclaunch (Cadence Incisive®)
— are on the system path. See your system documentation for
instruction on setting environment variables.
Make sure the HDL simulator executable is still on the system path after the shell is launched from MATLAB. If it is not, make sure the shell startup file does not remove it from the path environment variable.
Load an HDL Design for Verification
After you start the HDL simulator from MATLAB with a call
load an instance of an HDL module for verification or visualization
with the function
hdlsimmatlab. At this point, you should
have coded and compiled your HDL model. Issue the function
each instance of an entity or module in your model that you want to
cosimulate. For example (for use with Incisive®):
This command loads the HDL Verifier library, opens
a simulation workspace for
osc_top, and display
a series of messages in the HDL simulator command window as the simulator
loads the entity (see example for remaining code).