| Link for ModelSim | ![]() |
If the MATLAB server is not running, start it:
Start MATLAB.
In the MATLAB Command Window, call the hdldaemon function with property name/property value pairs that specify whether the Link for ModelSim interface is to
Use shared memory or TCP/IP socket communication
Return time values in seconds or as 64bit integers
Use the following syntax:
hdldaemon('PropertyName', PropertyValue...)
The following table explains when and how to specify property name/property value pairs.
Note 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 ModelSim simulator for use with a MATLAB with the matlabtb or matlabtbeval ModelSim command. In addition, if you specify TCP/IP socket mode, the socket port that you specify with this function and the ModelSim command must match. For more information on modes of communication, see Choosing TCP/IP Socket Ports. For more information on establishing the ModelSim end of the communication link, see Initializing the Simulator for a MATLAB Test Bench Session. |
| If Your Application Is To... | Do the Following... |
|---|---|
| Operate in shared memory mode | Omit the 'socket', tcp_spec property name/property value pair. The interface operates in shared memory mode by default. You should use shared memory mode if your application configuration consists of a single system and uses a single communication channel. |
| Operate in TCP/IP socket mode, using a specific TCP/IP socket port | Specify the 'socket', tcp_spec property name and value pair. The tcp_spec can be a socket port number or service name. Examples of valid port specifications include '4449', 4449, and MATLAB Service. For information on choosing a TCP/IP socket port, see Choosing TCP/IP Socket Ports. |
| Operate in TCP/IP socket mode, using a TCP/IP socket that the operating system identifies as available | Specify 'socket', 0 or 'socket', '0'. |
| Return time values in seconds (type double) | Specify 'time', 'sec' or omit the parameter. This is the default time value resolution. |
| Return 64-bit time values (type int64) | Specify 'time', 'int64' . |
The following function call starts the server in TCP/IP socket mode, using port number 4449, with a time resolution of seconds (the default).
hdldaemon('socket', 4449)
You also can start the server from a script. Consider the following function call sequence:
dstat = hdldaemon('socket', 0)
portnum = dstat.ipc_id
The first call to hdldaemon specifies that the server use TCP/IP communication with a port number that the operating system identifies and returns connection status information, including the assigned port number, to dstat. The statement on the second line assigns the socket port number to portnum for future reference.
| Checking the MATLAB Server's Link Status | Starting ModelSim for Use with MATLAB | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |