Main Content

HDL code coverage

Enable or disable HDL code coverage flags in generated simulator scripts

Model Configuration Pane: Test Bench

Description

Enable or disable HDL code coverage flags in the generated simulator scripts.

With this option enabled, when you run the HDL simulation, code coverage is collected for your generated test bench. Specify your HDL simulator in the SimulationTool property. The coder generates build-and-run scripts for the simulator you specify.

Dependencies

Make sure that the system selected is the DUT. This option is disabled if you select the entire model.

This option is ignored when GenerateCoSimBlock is selected and SimulationTool is set to 'Xilinx Vivado Simulator'.

Settings

Off (default) | On
Off

Disable HDL code coverage flags in the generated simulator scripts.

On

Enable HDL code coverage flags in the generated simulator scripts.

Tips

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

For example, you can enable the HDLCodeCoverage property when you generate a testbench 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', ... 
                'HDLCodeCoverage','on')
  • When you use hdlset_param, you can set the parameter on the model and then generate HDL code using makehdltb.

    hdlset_param('sfir_fixed','HDLCodeCoverage','on')
    makehdltb('sfir_fixed/symmetric_fir')

Recommended Settings

No recommendations.

Programmatic Use

Parameter: HDLCodeCoverage
Type: character vector
Value: 'on' | 'off'
Default: 'off'

Version History

Introduced in R2017a