| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| R2010b Documentation → Simulink HDL Coder |
| Contents | Index |
This table summarizes what's new in Version 1.4 (R2008b):
| New Features and Changes | Version Compatibility Considerations | Fixed Bugs and Known Problems | Related Documentation at Web Site |
|---|---|---|---|
| Yes Details below | Yes—Details labeled as Compatibility
Considerations, below. See also Summary. | Bug
Reports | No |
New features and changes introduced in this version are:
New hdldemolib Blocks Support FFT, HDL Counter, and Bitwise Operators
Additional Simulink Blocks Supported for HDL Code Generation
New Constant Block Implementation Indicates Hi-Z or Unknown States
hdlnewblackbox Function Generates Black Box Control Statements
hdlnewcontrolfile Function Optionally Returns Result to String
-novopt Flag Added to Default Simulation Command in Generated Compilation Scripts
The hdldemolib library now includes HDL-specific block implementations supporting simulation and code generation for:
Counter with count-limited and free-running modes (see HDL Counter in the Simulink HDL Coder documentation)
Minimum resource FFT (see HDL FFT in the Simulink HDL Coder documentation)
Bitwise operations, including bit slice, bit reduction, bit concatenation, bit shift, and bit rotation (see Bitwise Operators in the Simulink HDL Coder documentation)
The following figure shows the hdldemolib library window. See The hdldemolib Block Library in the Simulink HDL Coder documentation for more information about the library.

The coder now supports the following blocks for HDL code generation:
Signal Processing Blockset/Multirate Filters/CIC Interpolation
Signal Processing Blockset/Multirate Filters/FIR Interpolation
(See the demo "Digital Down Converter for HDL Code Generation" for an example of the use of this block.)
Signal Processing Blockset/Filtering /Adaptive Filters/LMS Filter
(See the demo "Adaptive Noise Canceler with LMS Filter" for an example of the use of this block.)
simulink/Logic and Bit Operations/Extract Bits
simulink/Math Operations/Math Function (now supports hermitian, and transpose functions for HDL code generation)
simulink/Model-Wide Utilities/DocBlock
Stateflow Truth Table
In addition, several HDL-specific block implementations have been added to the hdldemolib library. See New hdldemolib Blocks Support FFT, HDL Counter, and Bitwise Operators.
See the Simulink HDL Coder documentation for a complete listing of blocks that are currently supported for HDL code generation.
In the previous release, the coder introduced support for use of complex signals with a limited set of blocks. In R2008b, the coder supports complex signals for these additional blocks:
dspadpt3/LMS Filter
dspsigattribs/Frame Conversion
dspsigops/Delay (DSPDelayHDLEmission implementation)
hdldemolib/Dual Port RAM
hdldemolib/Simple Dual Port RAM
hdldemolib/Single Port RAM
hdldemolib/HDL FFT
simulink/Commonly Used Blocks/Relational Operator (~= and == operators only)
simulink/Discrete/Memory
simulink/Discrete/Zero-Order Hold
simulink/Logic and Bit Operations/Compare To Constant
simulink/Logic and Bit Operations/Compare To Zero
simulink/Lookup Tables/Lookup Table (LookupHDLInstantiation implementation)
simulink/Math Operations/Assignment
simulink/Math Operations/Math Function (hermitian, transpose)
simulink/Signal Attributes/Signal Specification
See Blocks That Support Complex Data in the Simulink HDL Coder documentation for a complete listing of blocks that support complex signals.
The coder now lets you add text annotations to generated code, in the form of comments. There are two ways to add annotations to your code:
Enter text directly on the block diagram as Simulink annotations.
Place a DocBlock at the desired level of your model and enter text comments.
See Annotating Generated Code with Comments and Requirements in the Simulink HDL Coder documentation for further information.
The coder now supports an implementation for the built-in/Constant block (hdldefaults.ConstantSpecialHDLEmission), which you can use to indicate when a constant signal is in high-impedance ('Z') or unknown ('X') state. The implementation provides the {Value} parameter to indicate the state, as follows:
{Value, 'Z'}: If the signal is in a high-impedance state, the Constant block emits the character 'Z' for each bit in the signal. For example, for a 4-bit signal, 'ZZZZ' would be emitted.
{Value, 'Z'} is the default value for this implementation.
{Value, 'X'}: If the signal is in an unknown state, the Constant block emits the character 'X' for each bit in the signal. For example, for a 4-bit signal, 'XXXX' would be emitted.
hdldefaults.ConstantSpecialHDLEmission does not support the double data type.
See also Blocks with Multiple Implementations in the Simulink HDL Coder documentation.
The new Test bench reference postfix option (shown in the following figure) lets you customize the names of reference signals generated in test bench code by specifying a string to be appended to reference signal names. The default string is'_ref'.

If you generate test bench code via the makehdltb function, use the Testbenchreferencepostfix property (see TestBenchReferencePostFix in the in the Simulink HDL Coder documentation) to specify the postfix string.
The default HDL implementations for certain blocks has been changed. The following table lists these blocks, as well as their new default implementations and previous default implementations. All listed implementation classes belong to the package hdldefaults.
| Block | Default
Implementation Before Release R2008b | New Default Implementation |
|---|---|---|
simulink/Commonly Used Blocks/Data Type Conversion | DataTypeConversionHDLEmission | DataTypeConversionRTW |
simulink/Commonly Used Blocks/Product | ProductLinearHDLEmission | ProductRTW |
simulink/Math Operations/Divide | ProductLinearHDLEmission | ProductRTW |
simulink/Math Operations/Product of Elements | ProductLinearHDLEmission | ProductRTW |
simulink/Commonly Used Blocks/Sum | SumLinearHDLEmission | SumRTW |
simulink/Math Operations/Add | SumLinearHDLEmission | SumRTW |
simulink/Math Operations/Sum of Elements | SumLinearHDLEmission | SumRTW |
simulink/Math Operations/Subtract | SumLinearHDLEmission | SumRTW |
simulink/Commonly Used Blocks/Unit Delay | UnitDelayHDLEmission | UnitDelayRTW |
simulink/Math Operations/MinMax | MinMaxTreeHDLEmission | MinMaxTree |
dspstat3/Maximum | MinMaxTreeHDLEmission | MinMaxTree |
dspstat3/Minimum | MinMaxTreeHDLEmission | MinMaxTree |
If your models use default HDL block implementations for the affected blocks, the coder will now default to the new implementations. The new implementations are compatible with the previous implementations and will produce identical results.
The older implementations for the listed blocks will be supported for a limited number of future releases. If your control files explicitly reference the previous default implementation for any of the affected blocks, the coder will continue to use the referenced implementation. You should consider removing or changing such references in your control files to use the new implementations.
The default value for the Entity conflict postfix property (and the corresponding CLI property, EntityConflictPostfix) has been changed from '_entity' to '_block'.
If your models or scripts rely on the previous default value ('_entity') for the Entity conflict postfix property, you will need to explicitly set the property value to '_entity'.
In the previous release, the coder introduced automatic pipeline insertion, a special optimization for HDL code generated from Embedded MATLAB Function blocks or Stateflow charts. This optimization was enabled implicitly by specifying the {'OutputPipeline', nStages} parameter in a control file for these blocks.
In the current release, the new DistributedPipelining parameter lets you explicitly enable or disable pipeline insertion, independently from the OutputPipeline parameter. The control file listed in the following example specifies two pipeline registers, with DistributedPipelining enabled.
function c = pipeline_control
c = hdlnewcontrol(mfilename);
c.forEach('*',...
'eml_lib/Embedded MATLAB Function', {},...
'hdlstateflow.StateflowHDLInstantiation', {'OutputPipeline', 2, 'DistributedPipelining', 'on'});The DistributedPipelining property applies only to Embedded MATLAB Function blocks or Stateflow charts within a subsystem.
For detailed information, see Distributed Pipeline Insertion for Embedded MATLAB Function Blocks in the Simulink HDL Coder documentation.
If your existing control files specified automatic pipelining implicitly using the OutputPipeline parameter, you should change your control files to specify automatic pipelining explicitly as in the following code excerpt:
c.forEach('*',...
'eml_lib/Embedded MATLAB Function', {},...
'hdlstateflow.StateflowHDLInstantiation', {'OutputPipeline', 2, 'DistributedPipelining', 'on'});The CoeffMultipliers implementation parameter lets you specify use of canonic signed digit (CSD) or factored CSD optimizations for processing coefficient multiplier operations in code generated for certain filter blocks. Specify the CoeffMultipliers parameter in a control file using the following syntax:
{'CoeffMultipliers', 'csd'}: Use CSD techniques to replace multiplier operations with shift and add operations. CSD techniques minimize the number of addition operations required for constant multiplication by representing binary numbers with a minimum count of nonzero digits. This decreases the area used by the filter while maintaining or increasing clock speed.
{'CoeffMultipliers', 'factored-csd'}: Use factored CSD techniques, which replace multiplier operations with shift and add operations on prime factors of the coefficients. This option lets you achieve a greater filter area reduction than CSD, at the cost of decreasing clock speed.
{'CoeffMultipliers', 'multipliers'} (default): Retain multiplier operations.
The coder supports CoeffMultipliers for the filter block implementations shown in the following table.
| Block | Implementation |
|---|---|
| dsparch4/Digital Filter | hdldefaults.DigitalFilterHDLInstantiation |
| dspmlti4/FIR Decimation | hdldefaults.FIRDecimationHDLInstantiation |
| dspmlti4/FIR Interpolation | hdldefaults.FIRInterpolationHDLInstantiation |
See also Block Implementation Parameters in the Simulink HDL Coder documentation.
The hdlnewblackbox function provides a simple way to create the control file statements that are required to generate black box interfaces for one or more subsystems.
Given a selection of one or more subsystems from your model, hdlnewblackbox returns the following as string data in the MATLAB workspace for each selected subsystem:
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.
For further information, see in the Simulink HDL Coder documentation.
The hdlnewcontrolfile function (optionally) now can return control statements to a string variable.
To return control statements as text in the string variable t, instead of returning a control file, use the following syntax:
t = hdlnewcontrolfile(...)
See also hdlnewcontrolfile in the Simulink HDL Coder documentation.
For improved operation with the ModelSim (version 6.2 and later) simulator, the default values of the HDLSimCmd property string (and the Simulation Command GUI option) now includes the -novopt flag, as follows:
'vsim -novopt work.%s\n'
The -novopt flag directs the ModelSim simulator not to perform optimizations that remove signals from the simulation view.
If you are using ModelSim 6.0 or an earlier version, you should set the HDLSimCmd property string (or the Simulation Command GUI option) to omit the -novopt option, as follows:
'vsim work.%s\n'
![]() | Version 1.5 (R2009a) Simulink HDL Coder Software | Version 1.3 (R2008a) Simulink HDL Coder Software | ![]() |

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