Main Content

Cosimulation model

Enable or disable generation of cosimulation model

Model Configuration Pane: HDL Code Generation / Test Bench

Description

The Cosimulation model parameter enables or disables the generation of a cosimulation model that includes a HDL Cosimulation block. A cosimulation model is an automatically generated Simulink model configured for both Simulink simulation and cosimulation of your design with an HDL simulator. HDL Coder™ supports automatic generation of a cosimulation model as a part of the test bench generation process.

This parameter requires HDL Verifier™. After you select this parameter, specify your simulator in the Simulation tool parameter. This parameter is not supported if you set Simulation tool to Custom.

The code generator configures the generated HDL Cosimulation blocks to conform to the port and data type interface of the DUT selected for code generation. By connecting an HDL Cosimulation block to your model in place of the DUT, you can cosimulate your design with the desired simulator.

For more information, see Generate a Cosimulation Model.

Dependencies

To enable this parameter:

Settings

off (default) | on
off

Disable generation of a cosimulation model that includes a HDL Cosimulation block.

on

Enable generation of a cosimulation model that includes a HDL Cosimulation block.

Tips

To set this property, use hdlset_param or makehdltb. To view the property value, use hdlget_param.

For example, you can enable the GenerateCoSimModel property when you generate a test bench for the symmetric_fir subsystem inside the sfir_fixed model using either of these methods:

  • Pass the property as an argument to the makehdltb function.

    makehdltb("sfir_fixed/symmetric_fir", ... 
                "GenerateCoSimModel","ModelSim")
  • When you use hdlset_param, set the parameter on the model and then generate HDL code using makehdltb.

    hdlset_param("sfir_fixed","GenerateCoSimModel","ModelSim")
    makehdltb("sfir_fixed/symmetric_fir")

Programmatic Use

Parameter: GenerateCoSimBlock | GenerateCoSimModel
Type: character vector
GenerateCoSimBlock Values: 'on' | 'off'
GenerateCoSimBlock Default: 'off'
GenerateCoSimModel Values: 'ModelSim' | 'Incisive' | 'Vivado Simulator' | 'None'
GenerateCoSimModel Default: 'ModelSim'

Limitations

When using the MATLAB-to-HDL workflow, you cannot enable the Cosimulation model parameter when the Language configuration parameter is SystemVerilog.

Version History

Introduced in R2012a

See Also

Blocks

Model Settings