| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → EDA Simulator Link |
| Contents | Index |
| Learn more about EDA Link Simulator |
| On this page… |
|---|
Depending on your particular configuration (for example, when the MATLAB software and the HDL simulator reside on separate machines), when creating an EDA Simulator Link MATLAB application or defining the block parameters of an HDL Cosimulation block, you may need to identify the TCP/IP socket port number or service name (alias) to be used for EDA Simulator Link connections.
To use the TCP/IP socket communication, you must choose a TCP/IP socket port number for the server component to listen on that is available in your computing environment. Client components can connect to a specific server by specifying the port number on which the server is listening. For remote network configurations, the Internet address helps distinguish multiple connections.
The socket port resource is associated with the server component of an EDA Simulator Link configuration. That is, if you use MATLAB in a test bench configuration, the socket port is a resource of the system running MATLAB. If you use a Simulink design in a cosimulation configuration, the socket port is a resource of the system running the HDL simulator.
For any given command or function, 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.
The port 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 examples.
Note You must use TCP/IP socket communication when your application configuration consists of multiple computing systems. |
For more information on choosing TCP/IP socket ports, see Choosing TCP/IP Socket Ports.
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 Start hdldaemon to Provide Connection to HDL Simulator.
A TCP/IP socket port number (or alias) is a shared resource. To avoid potential collisions, particularly on servers, you should use caution when choosing a port number for your application. Consider the following guidelines:
If you are setting up a link for MATLAB, consider the EDA Simulator Link option that directs the operating system to choose an available port number for you. To use this option, specify 0 for the socket port number.
Choose a port number that is registered for general use. Registered ports range from 1024 to 49151.
If you do not have a registered port to use, review the list of assigned registered ports and choose a port in the range 5001 to 49151 that is not in use. Ports 1024 to 5000 are also registered, however operating systems use ports in this range for client programs.
Consider registering a port you choose to use.
Choose a port number that does not contain patterns or have a known meaning. That is, avoid port numbers that more likely to be used by others because they are easier to remember.
Do not use ports 1 to 1023. These ports are reserved for use by the Internet Assigned Numbers Authority (IANA).
Avoid using ports 49152 through 65535. These are dynamic ports that operating systems use randomly. If you choose one of these ports, you risk a potential port conflict.
TCP/IP port filtering on either the client or server side can cause the EDA Simulator Link interface to fail to make a connection.
In such cases the error messages displayed by the EDA Simulator Link interface indicate the lack of a connection, but do not explicitly indicate the cause. A typical scenario caused by port filtering would be a failure to start a simulation in the HDL simulator, with the following warning displayed in the HDL simulator if the simulation is restarted:
#MLWarn - MATLAB server not available (yet), The entity 'entityname' will not be active
In MATLAB, checking the server status at this point indicates that the server is running with no connections:
x=hdldaemon('status')
HDLDaemon server is running with 0 connections
x=
4449Windows Users If you suspect that your chosen socket port is filtered, you can check it as follows:
|
Specifies TCP/IP socket communication for links between the HDL simulator and Simulink software. For TCP/IP socket communication on a single computing system, the <tcp_spec> parameter of matlabcp or matlabtb can consist of just a TCP/IP port number or service name. If you are setting up communication between computing systems, you must also specify the name or Internet address of the remote host.
If the HDL simulator and MATLAB are running on the same system, the TCP/IP specification identifies a unique TCP/IP socket port to be used for the link. If the two applications are running on different systems, you must specify a remote host name or Internet address in addition to the socket port. See Specifying TCP/IP Socket Communication for more detail in specifying TCP/IP values.
The following table lists different ways of specifying tcp_spec.
| Format | Example |
|---|---|
| <port-num> | 4449 |
| <port-alias> | matlabservice |
| <port-num>@<host> | 4449@compa |
| <host>:<port-num> | compa:4449 |
| <port-alias>@<host-ia> | matlabservice@123.34.55.23 |
An example of a matlabcp call using port 4449 might look like this:
> matlabcp u_osc_filter -mfunc oscfilter -socket 4449
A remote connection might look like this:
> matlabcp u_osc_filter -mfunc oscfilter -socket computer93:4449
By setting up the MATLAB server as a service, you can run the service in the background, allowing it to handle different HDL simulator client requests over time without you having to start and stop the service manually each time. Although it makes less sense to set up a service for the Simulink software as you cannot really automate the starting of an HDL simulator service, you might want to use a service with Simulink to reserve a TCP/IP socket port.
Services are defined in the etc/services file located on each computer; consult the User's Guide for your particular operating system for instructions and more information on setting up TCP/IP services.
For remote connections, the service name must be set up on both the client and server side. For example, if the service name is "matlabservice" and you are performing a Windows-Linux cross-platform simulation, the service name must appear in the service file on both the Windows machine and the Linux machine.
![]() | Establishing EDA Simulator Link Machine Configuration Requirements | Improving Simulation Speed | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |