Generate HDL Code for Filter System Objects

You can generate HDL code for a supported filter System
object™ by using the Filter Builder app, the Generate HDL dialog box,
or by calling the generatehdl function. You can also explore filter
architectures and generate test bench stimulus for a filter System
object by using the hdlfilterserialinfo, hdlfilterdainfo, and generatetbstimulus functions. In either cases, you must specify a
fixed-point data type for the System
object. The HDL code generation tool quantizes the input signal to this data
type.

Using Generate HDL Dialog Box

Open the Generate HDL dialog box by calling the fdhdltool function. When calling
the function with a System
object, specify the input data type as a numerictype object.
Create this object by calling numerictype(s,w,f), where
s is 1 for signed and 0 for unsigned, w is
the word length in bits, and f is the number of fractional bits.
In the following example, the call to numerictype(1,8,7)
specifies a signed 8-bit number with 7 fractional bits.

filt = dsp.BiquadFilter;
fdhdltool(filt,numerictype(1,8,7));

When
the dialog box opens, you can set HDL code generation options and generate code for
the System
object.

At the Command Line

When calling the generatehdl function with a
System
object, specify the input data type as a Name,Value pair
argument using the InputDataType
property. Specify the property value as a numerictype object. For
example: