Starting the HDL Simulator

Starting the HDL Simulator from MATLAB

Start the Cadence Incisive or NC Simulator simulator directly from MATLAB or Simulink by calling the MATLAB function nclaunch. This function starts and configures the HDL simulator for use with the EDA Simulator Link IN software. By default, the function starts the first version of the simulator executable (ncsim.exe) that it finds on the system path (defined by the path variable), using a temporary file that is overwritten each time the HDL simulator starts.

To start the HDL simulator from MATLAB, enter nclaunch at the MATLAB command prompt:

>> nclaunch

You can customize the startup file and communication mode to be used between MATLAB or Simulink and the HDL simulator by specifying the call to nclaunch with property name/property value pairs. Refer to nclaunch reference documentation for specific information regarding the property name/property value pairs.

See Examples of Starting the Cadence Incisive Simulator from MATLAB for examples of using nclaunch with various property/name value pairs and other parameters.

When you specify a communication mode using nclaunch, the function applies the specified communication mode to all MATLAB or Simulink/HDL simulator sessions.

Examples of Starting the Cadence Incisive Simulator from MATLAB

The following example changes the directory location to VHDLproj and then calls the function nclaunch. Because the command line omits the 'hdlsimdir' and 'startupfile' properties, nclaunch creates a temporary file. The 'tclstart' property specifies Tcl commands that load and initialize the HDL simulator for test bench instance modsimrand.

cd VHDLproj
nclaunch('tclstart',...
 'hdlsimmatlab modsimrand; matlabtb modsimrand 10 ns -socket 4449')

The following example changes the directory location to VHDLproj and then calls the function nclaunch. Because the function call omits the 'hdlsimdir' and 'startupfile' properties, nclaunch creates a temporary file. The 'tclstart' property specifies a Tcl command that loads the VHDL entity parse in library work for cosimulation between nclaunch and Simulink. The 'socketsimulink' property specifies TCP/IP socket communication on the same computer, using socket port 4449.

cd VHDLproj
nclaunch('tclstart', 'hdlsimulink work.parse', 'socketsimulink', '4449')

Another option is to bring ncsim up in the terminal instead of launching the Simvision GUI, thereby allowing you to interact with the simulation. This next example lists the steps necessary for you to do this:

  1. Start hdldaemon in MATLAB.

  2. Start an xterm from MATLAB in the background (key point).

  3. Run ncsim in the xterm shell having it call back to the hdlserver to run your matlabcp function as usual.

  4. Have the matlabcp function touch a file to signal completion while an M script polls for completion.

The M script can then change test parameters and run more tests.

Starting the Cadence Incisive HDL Simulator from a Shell

To start the HDL simulator from a shell and include the EDA Simulator Link IN libraries, you need to first run the configuration script. See Setting Up the HDL Simulator for Use with the Link Software.

After you have the configuration files, you can start the HDL simulator from the shell by typing:

% ncsim -f matlabconfigfile modelname

matlabconfigfile should be the name of the MATLAB configuration file you created either with the guided script (Linux/UNIX) or by creating the file yourself (Windows). If you are connecting to Simulink, this should be the name of the Simulink configuration file. Either way, you must also specify the path to the configuration file if it does not reside in the same directory as ncsim.exe.

You can also specify any other existing configuration files you may also be using with this call.

  


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