| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink HDL Coder |
| Contents | Index |
hdlnewcontrolfile
hdlnewcontrolfile('blockpath')
hdlnewcontrolfile({'blockpath1','blockpath2',...'blockpathN'})
t = hdlnewcontrolfile(...)
The coder provides the hdlnewcontrolfile utility to help you construct code generation control files. Given a selection of one or more blocks from your model, hdlnewcontrolfile generates a control file containing:
A c.generateHDLFor call specifying the full path to the currently selected block or subsystem from which code is to be generated.
c.forEach calls for all selected blocks that have HDL implementations.
Comments providing information about all supported implementations and parameters for all selected blocks that have HDL implementations.
c.set calls for any global HDL Coder options that are set to nondefault values.
Generated control files are automatically opened as untitled files in the MATLAB editor for further customization. The file naming sequence for successively generated control files is Untitled1, Untitled2,...UntitledN.
To use a generated control file in code generation, you must save it and attach it to a model. (See also Associating an Existing Control File with Your Model.)
hdlnewcontrolfile returns a control file containing a forEach statement and comments for each selected block in the model.
hdlnewcontrolfile('blockpath') returns a control file containing a forEach statement and comments for the block specified by the 'blockpath' argument. The 'blockpath' argument is a string specifying the full Simulink path to the desired block.
hdlnewcontrolfile({'blockpath1','blockpath2',...'blockpathN'}) returns a control file containing a forEach statement and comments for the blocks specified by the {'blockpath1','blockpath2',...'blockpathN'} arguments. The {'blockpath1','blockpath2',...'blockpathN'} arguments are passed as a cell array of strings, each string specifying the full Simulink path to a desired block.
t = hdlnewcontrolfile(...) returns control statements as text in the string variable t, instead of returning a control file.
You can use the generated control file as:
A starting point for development of a customized control file.
A source of information or documentation of the HDL code generation parameter settings in the model.
% Generate control file for a specific block
hdlnewcontrolfile('sfir_fixed/symmetric_fir/Product1');
%
% Generate a control file for all currently selected blocks
hdlnewcontrolfile;
%
% Generate a control file for two specific blocks
hdlnewcontrolfile({'sfir_fixed/symmetric_fir/Add1',...
'sfir_fixed/symmetric_fir/Product2'});
![]() | hdlnewcontrol | hdlnewforeach | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |