| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink HDL Coder |
| Contents | Index |
hdlnewblackbox
hdlnewblackbox('blockpath')
hdlnewblackbox({'blockpath1','blockpath2',...'blockpathN'})
[cmd, impl] = hdlnewblackbox
[cmd, impl] = hdlnewblackbox('blockpath')
[cmd, impl] = hdlnewblackbox({'blockpath1','blockpath2',...'blockpathN'})
[cmd, impl, params] = hdlnewblackbox
[cmd, impl, params] = hdlnewblackbox('blockpath')
[cmd, impl, params] = hdlnewblackbox({'blockpath1','blockpath2',...'blockpathN'})
The hdlnewblackbox utility helps you construct forEach calls for use in code generation control files when generating black box interfaces. Given a selection of one or more blocks from your model, hdlnewblackbox returns the following as string data in the MATLAB workspace for each selected block:
A forEach call coded with the correct modelscope, blocktype, and default implementation class (SubsystemBlackBoxHDLInstantiation) arguments for the block.
(Optional) a cell array of strings enumerating the available implementations classes for the subsystem, in package.class form.
(Optional) A cell array of cell arrays of strings enumerating the names of implementation parameters (if any) corresponding to the implementation classes. hdlnewblackbox does not list data types and other details of implementation parameters.
hdlnewblackbox returns a forEach call for each selected block in the model.
hdlnewblackbox('blockpath') returns a forEach call for the block specified by the 'blockpath' argument. The 'blockpath' argument is a string specifying the full Simulink path to the desired block.
hdlnewblackbox({'blockpath1','blockpath2',...'blockpathN'}) returns a forEach call 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.
[cmd, impl] = hdlnewblackbox returns a forEach call for each selected block in the model to the string variable cmd. The call also returns impl, a cell array of cell arrays of strings enumerating the available implementations for the block.
[cmd, impl] = hdlnewblackbox('blockpath') returns a forEach call for the block specified by the 'blockpath' argument to the string variable cmd. The call also returns impl, a cell array of cell arrays of strings enumerating the available implementations for the block. The 'blockpath' argument is a string specifying the full Simulink path to the desired block.
[cmd, impl] = hdlnewblackbox({'blockpath1','blockpath2',...'blockpathN'}) returns a forEach call for the blocks specified by the {'blockpath1','blockpath2',...'blockpathN'} arguments to the string variable cmd. The call also returns impl, a cell array of cell arrays of strings enumerating the available implementations for the block. The {'blockpath1','blockpath2',...'blockpathN'} arguments are passed as a cell array of strings, each string specifying the full Simulink path to a desired block.
[cmd, impl, params] = hdlnewblackbox returns a forEach call for each selected block in the model to the string variable cmd. The call also returns:
impl, a cell array of cell arrays of strings enumerating the available implementations for the block.
params, a cell array of cell arrays of strings enumerating the available implementation parameters corresponding to each implementation.
[cmd, impl, params] = hdlnewblackbox('blockpath') returns a forEach call for the block specified by the 'blockpath' argument to the string variable cmd. The call also returns:
impl, a cell array of cell arrays of strings enumerating the available implementations for the block.
params, a cell array of cell arrays of strings enumerating the available implementation parameters corresponding to each implementation.
The 'blockpath' argument is a string specifying the full Simulink path to the desired block.
[cmd, impl, params] = hdlnewblackbox({'blockpath1','blockpath2',...'blockpathN'}) returns a forEach call for the blocks specified by the {'blockpath1','blockpath2',...'blockpathN'} arguments to the string variable cmd. The call also returns:
impl, a cell array of cell arrays of strings enumerating the available implementations for the block.
params, a cell array of cell arrays of strings enumerating the available implementation parameters corresponding to each implementation.
The {'blockpath1','blockpath2',...'blockpathN'} arguments are passed as a cell array of strings, each string specifying the full Simulink path to a desired block.
Before invoking hdlnewblackbox, you must run checkhdl or makehdl to build in-memory information about the model. If you do not run checkhdl or makehdl, hdlnewblackbox will display an error message indicating that you should run checkhdl or makehdl.
After invoking hdlnewblackbox, you will generally want to insert the forEach calls returned by the function into a control file, and use the implementation information returned to specify a nondefault block implementation.
% Return a forEach call for a specific subsystem to the MATLAB workspace
hdlnewblackbox('sfir_fixed/symmetric_fir');
%
% Return forEach calls for all currently selected blocks to the MATLAB workspace
hdlnewblackbox;
%
% Return forEach calls, implementation names, and implementation parameter names
% for all currently selected blocks to string variables
[cmd,impl,parms] = hdlnewblackbox;
![]() | hdllib | hdlnewcontrol | ![]() |

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 |