Black box for including custom HDL code
hdl.BlackBox
provides
a way to include custom HDL code, such as legacy or handwritten HDL
code, in a MATLAB® design intended for HDL code generation.
When you create a user-defined System object™ that inherits
from hdl.BlackBox
, you specify a port interface and
simulation behavior that matches your custom HDL code.
HDL Coder™ simulates the design in MATLAB using the behavior you define in the System object. During code generation, instead of generating code for the simulation behavior, the coder instantiates a module with the port interface you specify in the System object.
To use the generated HDL code in a larger system, you include the custom HDL source files with the rest of the generated code.
To include custom HDL code:
Create the hdl.BlackBox
object and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?.
Note
Starting in R2016b, instead of using the step
method
to perform the operation defined by the System object, you can call the object with arguments, as if it were a function. For
example, y = step(obj,x)
and y = obj(x)
perform
equivalent operations.
creates a black box
System object for HDL code generation.B
= hdl.BlackBox
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)