generatehdl - Generate HDL code for quantized filter

Syntax

generatehdl(Hd)
generatehdl(Hd 'PropertyName', 'PropertyValue',...)

Description

generatehdl(Hd) generates HDL code for a quantized filter. The argument Hd must be a handle to a filter object. The function uses default settings for properties that determine file and HDL element naming, whether optimizations are applied, HDL coding styles, and test bench characteristics. The defaults are summarized below.

Defaults for Naming, Location and Packaging of Generated Files
Default Settings for Register Resets

Default Settings for General HDL Code
Default Settings for Code Optimizations

generatehdl(Hd 'PropertyName', 'PropertyValue',...) generates HDL code for the filter identified by Hd, using the specified property name and property value pair settings. You can specify the function with one or more of the property name and property value pairs described in Property Reference, and Properties — Alphabetical List.

Example

  1. Design a filter. The call to fdesign in the following command line sequence designs a minimum order lowpass filter with a normalized passband frequency of 0.2, a stopband frequency of 0.22, a passband ripple of 1 dB, and a stopband attenuation of 60 dB.

  2. Construct a filter object. The call to design constructs the FIR equiripple filter object Hd.

  3. Set the filter arithmetic. The arithmetic assignment statement sets the filter arithmetic to fixed-point arithmetic.

  4. Generate VHDL code for the filter. The call to generatehdl generates VHDL code for the FIR equiripple filter Hd. The function names the file MyFilter.vhd and places it in the default target directory hdlsrc.

d = fdesign.lowpass('Fp,Fst,Ap,Ast',0.2, 0.22, 1, 60);
Hd = design(d, 'equiripple');  % Create filter
Hd.arithmetic='fixed';
generatehdl(Hd, 'Name', 'MyFilter'); %Generate VHDL code

See Also

generatetb, generatetbstimulus

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS