| Filter Design HDL Coder™ | ![]() |
The Generate M-file option of the Generate HDL dialog box makes command-line scripting of HDL filter code and test bench generation easier. The option is located in the Script settings section of the Generate HDL dialog box, as shown in the following figure.

By default, Generate M-file is cleared.
When you select Generate M-file and generate code, the coder captures all nondefault HDL code and test bench generation settings from the GUI and writes out an M-file you can use to regenerate HDL code for the filter. The M-file contains:
Header comments that document the design settings for the filter object from which code was generated.
A function that takes a filter object as its argument, and passes the filter object in to generatehdl and generatetb commands. The property/value pairs passed to these commands correspond to the code generation settings in effect at the time the file was generated.
The M-file is written to the target directory. The naming convention for the file is filter_generatehdl.m, where filter is the filter name defined in the Name option.
When code generation completes, the M-file opens automatically for inspection and editing.
In subsequent sessions, you can use the information in the M-file comments to construct a filter object that is compatible with the generatehdl and generatehdltb commands in the M-file. Then you can execute the M-file function, passing in the filter object, to generate HDL code.
![]() | Customizing the HDL Code | Generating Code for Multirate Filters | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |