Main Content

Generate Black Box Interface for Referenced Model

When to Generate a Black Box Interface

Specify a black box implementation for the Model block when you already have legacy or manually-written HDL code. HDL Coder™ generates the HDL code that is required to interface to the referenced HDL code.

Code is generated with the following assumptions:

  • Every HDL entity or module requires clock, clock enable, and reset ports. Therefore, these ports are defined for each generated entity or module.

  • Use of Simulink® data types is assumed. For VHDL® code, port data types are assumed to be STD_LOGIC or STD_LOGIC_VECTOR.

If you want to generate code for a multirate, multiclock DUT that includes a referenced model, see Model Referencing for HDL Code Generation.

How to Generate a Black Box Interface

To instantiate an HDL wrapper, or black box interface, for a referenced model:

  1. Right-click the Model block and select HDL Code > HDL Block Properties.

    In the HDL Block Properties dialog box:

  2. Generate HDL code for your DUT subsystem.

Caveats and Limitations

  • If you run the checkhdl function to check the compatibility of your model for HDL code generation, the function does not check the port data types within the referenced model.

  • If you encounter typing or naming conflicts between vector ports when interfacing two or more generated VHDL code modules, use the ScalarizePorts property to generate nonconflicting port definitions. For more information, see Scalarize ports.

Related Topics