Main Content

fdhdltool

Open Generate HDL dialog box (To be removed)

fdhdltool function will be removed in a future release. Instead, use the DSP HDL IP Designer (DSP HDL Toolbox) app, System objects, or Simulink® blocks from DSP HDL Toolbox™. To generate HDL code from DSP HDL Toolbox algorithms, you must also have the HDL Coder™ product.

Description

fdhdltool(filtSO,nt) opens the Generate HDL dialog box to set options and generate HDL code for the specified filter System object™ and the input data type, specified by nt.

When the dialog box opens, it displays default values for code generation options that apply to the filter. You can then specify code generation options and generate HDL code. You can also use this dialog box to generate HDL test bench code and scripts for third-party EDA tools.

fdhdltool operates on a copy of the filter, not the original object in the workspace. After you call fdhdltool, changes made to the original filter do not apply to the copy. The Generate HDL dialog box does not update either. The naming convention for the copied filter is filt_copy, where filt is the name of the original filter.

example

fdhdltool(filtSO,nt,fd) opens the Generate HDL dialog box to set options and generate HDL code for a dsp.VariableFractionalDelay filter System object. Specify the input data type by nt, and the fractional delay data type by fd.

fdhdltool(filterObj) opens the Generate HDL dialog box to set options and generate HDL code for the specified dfilt filter object.

Examples

collapse all

Design a direct form symmetric equiripple filter with these specifications:

  • Passband frequency of 20 kHz

  • Stopband frequency of 24 kHz

  • Passband ripple of 0.01 dB

  • Stopband attenuation of 80 dB

  • Sampling frequency of 96 kHz

The design function returns a dsp.FIRFilter System object™ that implements the specification.

filtSpecs = fdesign.lowpass(20e3,24e3,0.01,80,96e3);
FIRLowpass = design(filtSpecs,'equiripple','FilterStructure','dfsymfir','SystemObject',true)
FIRLowpass = 
  dsp.FIRFilter with properties:

            Structure: 'Direct form symmetric'
      NumeratorSource: 'Property'
            Numerator: [1.0908e-04 2.1016e-05 -2.3369e-04 -2.8798e-04 9.0899e-05 3.6470e-04 -5.3240e-05 -5.8338e-04 -1.6344e-04 7.4544e-04 4.8812e-04 -8.4772e-04 -9.5828e-04 7.9705e-04 0.0015 -5.2252e-04 -0.0022 -4.9607e-05 0.0028 ... ] (1x101 double)
    InitialConditions: 0

  Use get to show all properties

When the filter is a System object, you must specify a fixed-point data type for the input data.

T = numerictype(1,16,15);

Open the Generate HDL dialog box by passing the filter and the data type as arguments.

fdhdltool(FIRLowpass,T)

Input Arguments

collapse all

Filter from which to generate HDL code, specified as a filter System object. To create a filter System object, use the design function or see the reference page of the object. You can use the following System objects from DSP System Toolbox™:

Multirate Filters

Input data type, specified as a numerictype object. This argument applies only when the input filter is a System object. Call 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.

Fractional delay data type, specified as a numerictype object. This argument applies only when the input filter is a dsp.VariableFractionalDelay System object. Call 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.

Filter from which to generate HDL code, specified as a dfilt object. You can create this object by using the design function. For an overview of supported filter features, see Filter Configuration Options.

Version History

Introduced in R2007a