| Link for ModelSim | ![]() |
Start the MATLAB server component of the Link for ModelSim interface
hdldaemon
hdldaemon('PropertyName', 'PropertyValue'...)
hdldaemon('status')
hdldaemon('kill')
Server Activation
hdldaemon starts the MATLAB server component of the Link for ModelSim with the following default settings:
Shared memory communication enabled
Time resolution for the MATLAB simulation function output ports set to scaled (type double)
Use shared memory communication when your application configuration consists of a single system.
Note The communication mode that you specify (shared memory or TCP/IP sockets) must match what you specify for the communication mode when you issue the matlabtb or matlabtbeval command in ModelSim. In addition, if you specify TCP/IP socket mode, you must also identify a socket port to be used for establishing links. You can choose and specify a socket port yourself, or you can use an option that instructs the operating system to identify an available socket port for you. Regardless of how the socket port is identified, the socket you specify with the ModelSim command must match the socket being used by the server. For more information on modes of communication, see Modes of Communication. For more information on establishing the ModelSim end of the communication link, see Initializing the Simulator for a MATLAB Test Bench Session. |
hdldaemon('PropertyName', 'PropertyValue'...) starts the MATLAB server component of the Link for ModelSim with property-value pair settings that specify the mode of the communication for the link between MATLAB and ModelSim and the time resolution for the MATLAB simulation function output ports. See Property Name/Property Value Pairs for details.
Link Status
hdldaemon('status') returns the following message indicating that a link (connection) exists between MATLAB and ModelSim:
HDLDaemon socket server is running on port 4449 with 0 connections
You can also use this function to check on the mode of communication being used, the number of existing connections, and that an interprocess communication identifier (ipc_id) being used for a link by assigning the return value of hdldaemon to a variable. The ipc_id identifies a port number for TCP/IP socket links or the file system name for a shared memory communication channel. For example:
x=hdldaemon('status')
x =
comm: 'sockets'
connections: 0
ipc_id: '4449'
This function call indicates that the server is using TCP/IP socket communication with socket port 4449 and is running with no active ModelSim clients. If a shared memory link is in use, the value of comm is 'shared memory' and the value of ipc_id is a file system name for the shared memory communication channel.
Server Shutdown
hdldaemon('kill') Shuts down the MATLAB server without shutting down MATLAB.
Specifies the TCP/IP socket mode of communication for the link between MATLAB and ModelSim. If you omit this argument, the server uses the shared memory mode of communication.
Note You must use TCP/IP socket communication when your application configuration consists of multiple computing systems. |
The tcp_spec can be a TCP/IP port number, TCP/IP port alias or service name, or the value zero, indicating that the port is to be assigned by the operating system. Some valid tcp_spec examples follow:
| Option | Examples |
|---|---|
| Port number | '4449' or 4449 |
| Alias or service name | 'MATLAB Service' |
| Operating system assigned | '0' or 0 |
For more information on choosing TCP/IP socket ports, see Choosing TCP/IP Socket Ports.
Note If you specify the operating system option ('0' or 0), use hdldaemon('status') to acquire the assigned socket port number. You must specify this port number when you issue a link request with the matlabtb or matlabtbeval command in ModelSim. |
Specifies the time resolution for MATLAB function output ports and simulation times (tnow).
| Specify... | For... |
|---|---|
| 'time' 'sec' (default) | A double value that is scaled to seconds based on the current ModelSim simulation resolution |
| 'time' 'int64' | 64bit integer representing the number of simulation steps |
If you omit this argument, the server uses scaled resolution time.
The following function call starts the MATLAB server with shared memory communication enabled and a 64bit time resolution format for the MATLAB function's output ports.:
hdldaemon('time', 'int64')
The following function call starts the MATLAB server with TCP/IP socket communication enabled on socket port 4449. Although it is not necessary to use TCP/IP socket communication on a single-computer application, you can use that mode of communication locally. A time resolution is not specified. Thus, the default, scaled simulation time resolution is applied to the MATLAB function's output ports:
hdldaemon('socket', 4449)
The following function call starts the MATLAB server with TCP/IP socket communication enabled on port 4449. A 64bit time resolution format is also specified:
hdldaemon('socket', 4449, 'time', 'int64')
| MATLAB Functions Alphabetical List | setupmodelsim | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |