The HDL Verifier™ Cosimulation Wizard lets you take existing HDL code, from any source, and use it to create a MATLAB® component or test bench function, System object™, or Simulink® HDL Cosimulation block. You can then use one of these cosimulation interfaces for cosimulation with a supported HDL simulator. See Supported EDA Tools and Hardware.
After you finish running the wizard, you must complete some missing pieces in the generated cosimulation interface. For example, if you specified a MATLAB function, the generated script contains some simple port I/O instructions and empty routines, which you must fill in before you can run HDL cosimulation.
You are expected to understand the following about the HDL code you want to import:
The name of the HDL files or compilation scripts to use in creating the block or function
Supported Data Types in HDL/MATLAB/Simulink
For Simulink blocks and MATLAB System objects:
The name of the top module to be used for cosimulation
Output port types and sample times
Whether there are clocks and resets and which of them you want to use, and timing parameters
For MATLAB functions:
Whether you want to create a component function or test bench function, or both
How you want to trigger the callback (rising or falling edge, repeat, sensitivity)
For Simulink blocks, you must also have a destination model to receive the generated cosimulation interface block.
The Cosimulation Wizard guides you through specifying this information (some information depends on which type of cosimulation interface you want it to create):
Type of cosimulation (MATLAB, MATLAB System object, or Simulink)
Which HDL simulator to use
HDL files to be included and compilation instructions
HDL module information
Input and output port details
Clock and reset information and HDL simulator start time alignment
When you are ready to begin:
Close your ModelSim® or Incisive® simulator.
Open the Cosimulation Wizard from the MATLAB command prompt:
Follow the workflow specific to the cosimulation interface you want to create:
On each selection pane there is a status window and navigational options.
The status window displays the current options you have selected. Warnings are displayed here also.
Click Help to display this HDL Code Import topic.
Click Cancel to exit the Cosimulation Wizard without creating a cosimulation component.
Click Back and Next to navigate forwards and backwards, respectively, through the application. Note that you can move forwards only after you have provided all information for the step you are on.
The last step of the Cosimulation Wizard generates the function scripts, System objects, or blocks and launches the specified HDL simulator.
If you select a function or System object, the MATLAB Editor opens with the unfinished script or System object ready for editing.
If you select a block, Simulink opens with the new block inside an untitled model.
When creating an HDL Cosimulation block or System object for use with Simulink, you may access only the I/O ports on the top level of the HDL design. If you want to cosimulate at multiple levels of your design, you cannot use this application to set up your HDL Cosimulation block or System object.
You cannot create multiple HDL Cosimulation blocks, nor can you use multiple generated HDL Cosimulation blocks in the same model. This is primarily because you can only access the top level of the HDL design. There is no need for additional blocks.