hdldaemon - Start MATLAB server component of EDA Simulator Link DS software

Syntax

hdldaemon
hdldaemon('PropertyName', 'PropertyValue'...)
hdldaemon('status')
hdldaemon('kill')

Description

Use hdldaemon to activate servers, check link status, and shutdown servers.

Server Activation

hdldaemon starts the MATLAB server component of the EDA Simulator Link DS software with the following default settings:

You can use TCP/IP on a single system (one that runs both MATLAB and the HDL simulator). However, consider using shared memory communication when your application configuration consists of a single system. This approach can result in increased performance.

Only one hdldaemon per MATLAB session can be running at any given time.

Matching Communication Modes and Socket Ports

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 matlabcp, matlabtb, or matlabtbeval command in the HDL simulator.

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 then 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 you identify the socket port, the socket you specify with the HDL simulator must match the socket being used by the server.

For more information on modes of communication, see Communicating with MATLAB or Simulink and the HDL Simulator. For more information on establishing the HDL simulator end of the communication link, see Associating a MATLAB Link Function with an HDL Module.

hdldaemon('PropertyName', 'PropertyValue'...) starts the EDA Simulator Link DS MATLAB server component with property-value pair settings. These settings specify the communication mode for the link between MATLAB and the HDL simulator and the resolution of tnow (the current time argument passed by the associated m-function). See hdldaemon Property Name/Property Value Pairs for details.

Link Status

hdldaemon('status') returns the following message indicating that a link (connection) exists between MATLAB and the HDL simulator:

HDLDaemon socket server is running on port 4449 with 0 connections

You can also use this function to check on the communication mode being used, the number of existing connections, and the 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 HDL simulator clients. If you are using a shared memory link, set the value of comm to 'shared memory' and make the value of ipc_id a file system name for the shared memory communication channel. For example:

x=hdldaemon('status')
HDLDaemon shared memory server is running with 0 connections
x = 
           comm: 'shared memory'
    connections: 0
         ipc_id: [1x45 char]

Server Shutdown

hdldaemon('kill') shuts down the MATLAB server without shutting down MATLAB.

Property Name/
Property Value Pairs

hdldaemon accepts the following valid property name/property value pairs:

'socket', tcp_spec

Specifies the TCP/IP socket mode of communication for the link between MATLAB and the HDL simulator. If you omit this argument, the server uses the shared memory mode of communication.

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. See Specifying TCP/IP Values for some valid tcp_spec examples.

For more information on choosing TCP/IP socket ports, see Choosing TCP/IP Socket Ports.

'time', 'sec' | 'time', 'int64'

Specifies the time resolution for MATLAB function ports and simulation times (tnow).

Specify...For...
'time' 'sec' (default)A double value that is scaled to seconds based on the current HDL simulation resolution
'time' 'int64'64-bit integer representing the number of simulation steps

If you omit this argument, the server uses scaled resolution time.

'quiet', 'true'

Suppresses printing messages to the standard queue. Errors still appear.

The following table provides guidelines on when and how to specify property name/property value pairs.

If Your Application Is to...Do the Following...
Operate in shared memory modeOmit 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 portSpecify 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 availableSpecify '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' .
Suppress server shutdown message when using hdldaemon to get an unused socket number (message can appear confusing)Specify 'quiet', 'true'.

Examples

The following function call starts the MATLAB server with shared memory communication enabled and a 64-bit time resolution format for the MATLAB function's tnow parameter:

hdldaemon('time', 'int64')

The following function call starts the MATLAB server with TCP/IP socket communication enabled on socket port 4449. Although you do not need to use TCP/IP socket communication on a single-computer application, you can use that mode of communication locally. Because the function does not specify a time resolution, the HDL simulator applies the default, scaled simulation time resolution 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. This call also specifies a 64-bit time resolution format:

hdldaemon('socket', 4449, 'time', 'int64')

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.

  


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