Contents

Batch Mode Cosimulation of Manchester Receiver

This example illustrates using MATLAB® to start Incisive® HDL simulator in batch mode and performing cosimulation with Simulink® using the HDL Verifier™ HDL Cosimulation block.

The commands displayed in the illustration above show the following steps:

  • The call to the HDL Verifier nclaunch command starts HDL simulator in batch mode by setting the 'runmode' property to 'Batch'. Issuing nclaunch also compiles and elaborates the HDL design, and loads the HDL Verifier HDL cosimulation library.

      nclaunch( ...
        'rundir', 'TEMPDIR', ...
        'tclstart', { ...
          ['exec ncvlog -linedebug ' vlogFiles{:}], ...
           'exec ncelab -access +rwc manchester', ...
           'hdlsimulink manchester' }, ...
           'runmode', 'Batch');
The HDL simulator has been started in the background. When linking with
MATLAB, the HDL simulator starts the simulation automatically when the
'run' command is provided with the 'tclstart' property of the nclaunch command.
When linking with Simulink, the HDL simulator is blocked after startup by
the hdlsimulink command. It is unblocked by starting the cosimulation from
Simulink. To unblock and exit the HDL simulator without initiating a
cosimulation session, use the breakHdlSim command in MATLAB.
When linking with MATLAB System Object, the HDL simulator is blocked after startup by
the hdlsimmatlabsysobj command. It is unblocked by starting the cosimulation from
MATLAB. To unblock and exit the HDL simulator without initiating a
cosimulation session, use the breakHdlSim command in MATLAB.
 
  • The HDL simulator process starts in the background. MATLAB and Simulink now wait to begin cosimulation.

  • The HDL Verifier pingHdlSimpingHdlSim command detects if the HDL simulator server is ready for cosimulation. The timeout argument to pingHdlSim specifies that it will wait for 100 seconds for HDL simulator to start. If HDL simulator fails to start within that time, an error is reported.

     pingHdlSim(100);
  • Simulink begins cosimulation when MATLAB detects (through pingHdlSim) that the HDL simulator server is ready.

     sim('manchester_batch_incisive',[0 50000]);

  • When the cosimulation completes, the HDL simulator exits automatically.

Was this topic helpful?