Main Content

Guided Code Generation

Guided code generation using the Configuration Parameters dialog box and Simulink HDL Workflow Advisor

You can generate HDL code for Simulink® models from the UI by using the HDL Code tab in the Simulink toolstrip or by using the Configuration Parameters dialog box. In this dialog box, you can specify various HDL code generation settings including basic folder and language selection to more advanced optimization parameters. To learn about how to generate HDL code from the HDL Code tab, see Generate HDL Code from Simulink Model.

To deploy the generated code to a target device, use the Simulink HDL Workflow Advisor. The Advisor can run end-to-end workflows that check HDL compatibility and deploy the generated code to a target device. HDL Workflow Advisor is not available in Simulink Online™.

Functions

hdladvisorDisplay HDL Workflow Advisor
hdlsetupSet up model parameters for HDL code generation
hdlsetuptoolpathSet up system environment to access FPGA synthesis software

Model Settings

expand all

Generate HDL forSelect the subsystem or model for HDL code generation
LanguageSpecify HDL code generation language
Code Generation FolderSpecify target folder for generated HDL code
Restore Model Defaults
Run Compatibility Checker
Generate
WorkflowSpecify the target workflow
Project FolderFolder specification for workflow-specific files (Since R2023b)
Target PlatformSpecify where to deploy generated HDL code (Since R2023b)
Synthesis ToolSpecify the synthesis tool for targeting the generated HDL code
FamilySpecify target device chip family for the model
DeviceSpecify target device name
PackageSpecify target device package name
SpeedSpecify target device speed value
Reference DesignConfiguration parameters to customize reference design (Since R2023b)
Reference Design Tool VersionDisplay of reference design tool version (Since R2023b)
Ignore tool version mismatchWarning in instances of reference design tool version mismatch (Since R2023b)
Reference Design ParametersParameters available for default reference designs (Since R2023b)
Target FrequencySpecify target frequency for multiple features and workflows

General

Map pipeline delays to RAMMap pipeline registers in the generated HDL code to RAM
RAM mapping thresholdSpecify the minimum RAM size for mapping to block RAMs
Transform non zero initial value delaySpecify Transform Delay blocks to have zero initial value (Since R2020b)
Remove Unused PortsRemove unused ports from the design (Since R2020b)
Enable-based constraintsMeet the timing requirement of the multicycle path in your model

Pipelining

Allow design delay distributionWhether to allow distributed pipelining and delay absorption optimizations to move design delays
Pipeline distribution priorityPriority for the distributed pipelining and delay absorption optimizations
Clock-rate pipeliningInsert pipeline registers at a clock rate that is faster than the data rate
Allow clock-rate pipelining of DUT output portsProduce the DUT outputs as soon as possible by passing the outputs from the DUT at the clock rate rather than the data rate
Balance clock-rate pipelined DUT output portsSynchronize the DUT outputs while satisfying the highest-latency requirements of the outputs (Since R2022b)
Distributed pipeliningEnable pipeline register distribution
Use synthesis estimates for distributed pipeliningDetermine more accurate propagation delays for each component (Since R2022a)
Adaptive pipeliningInsert pipeline registers to the blocks in your design, reduce the area usage, and maximize the achievable clock frequency on the target FPGA device
Map lookup tables to RAM Lookup tables in your design to block RAM and reduce area usage on the target FPGA device (Since R2021b)

Resource Sharing

Share AddersShare adders with the resource sharing optimization
Adder sharing minimum bitwidthSpecify the minimum bit width that is required to share adders with the resource sharing optimization
Share MultipliersShare multipliers with the resource sharing optimization
Multiplier sharing minimum bitwidthSpecify the minimum bit width that is required to share multipliers with the resource sharing optimization
Multiplier promotion thresholdShare smaller multipliers with other larger multipliers by using the resource sharing optimization
Multiplier partitioning thresholdPartition multipliers based on a threshold
Multiply-Add blocksShare Multiply-Add blocks with the resource sharing optimization (Since R2021a)
Multiply-Add block sharing minimum bitwidthSpecify the minimum bit width that is required to share Multiply-Add with the resource sharing optimization (Since R2021a)
Atomic subsystemsShare Atomic Subsystem blocks with the resource sharing optimization
MATLAB Function blocksShare MATLAB Function blocks with the resource sharing optimization
Floating-Point IPsShare floating-point IPs in the design

Frame to Sample Conversion

Enable frame to sample conversionEnable frame-to-sample conversion (Since R2022b)
Samples per cycleSpecify the size of the signals after the frame-to-sample conversion streams them (Since R2022b)
Input FIFO sizeSpecify the register size of the generated input FIFOs around the streaming matrix partitions (Since R2022b)
Output FIFO sizeSpecify the register size of the generated output FIFOs around the streaming matrix partitions (Since R2022b)
Input processing orderChoose between row-major and column-major ordering for the frame inputs (Since R2023a)
Delay size threshold for external memory (bits)Specify a threshold size in kilobytes to map large integer delays to input and output DUT ports and offload large delays to external memory outside of your FPGA (Since R2023a)
Use Floating PointSpecify use of native floating-point library (Since R2023a)
Latency StrategySpecify minimum or maximum latency (Since R2020b)
Handle DenormalsSpecify whether to handle denormal numbers (Since R2020b)
Mantissa Multiplier StrategySpecify how to implement the mantissa multiplication operation (Since R2020b)
Vendor Specific Floating Point LibrarySelect vendor-specific floating-point library (Since R2023a)

Global Settings

Reset typeAsynchronous or synchronous reset logic for registers
Reset asserted levelAsserted or active level of the reset input signal
Clock input portName for clock input port
Clock enable input port Name for clock enable input port
Reset input portName for reset input port
Clock inputsGeneration of single or multiple clock inputs
Treat Simulink rates as actual hardware ratesOversampling value based on model rates (Since R2023b)
Clock edgeActive clock edge
Oversampling factorOversampling value

General

Verilog file extensionFile name extension for generated Verilog files
VHDL file extensionFile name extension for generated VHDL files
SystemVerilog file extensionFile name extension for generated SystemVerilog files (Since R2023b)
Package postfixText to append to model or subsystem name
Entity conflict postfixText to resolve duplicate module names
Split entity file postfixText to be appended to model name to form name of generated entity file
Reserved word postfixText to append to value names, postfix values, or labels
Split arch file postfixText to be appended to model name to form name of generated architecture file
Clocked process postfixPostfix as character vector
Split entity and architectureNumber of files entity and architecture code is written to
Complex real part postfixText to append to real part of complex signal names
VHDL architecture nameArchitecture name for DUT
Complex imaginary part postfixText to append to imaginary part of complex signal names
Module name prefixPrefix for module or entity name
Enable prefixBase name as character vector
Timing controller postfixPostfix as character vector
Pipeline postfixText to append to names of input or output pipeline registers
VHDL library nameTarget library name for generated VHDL code
Generate VHDL or SystemVerilog code for model references into a single libraryCode placement for model references
Block generate labelPostfix to block labels used for HDL GENERATE statements
Output generate labelPostfix to output assignment block labels
Instance generate labelText to append to instance section labels
Vector prefixPrefix to vector names
Instance prefixPrefix to generated component instance names
Instance postfixPostfix to generated component instance names
Map file postfixPostfix appended to file name for generated mapping file

Ports

Input data typeHDL data type for the input ports of the model
Output data typeHDL data type for the output ports of the model
Clock Enable output portName for the generated clock enable output port
Minimize clock enablesMinimize clock enable logic
Minimize global resetsMinimize reset logic
Use trigger signal as clockTrigger input signal
Enable HDL DUT port generation for tunable parametersEnable creation of DUT input ports for tunable parameters (Since R2021b)
Balance delays for generated DUT input portsInsert matching delays on generated DUT inport port paths (Since R2022b)
Enable HDL DUT port generation for test pointsEnable creation of DUT output ports for the test point signals
Balance delays for generated DUT output portsInsert matching delays on generated DUT output port paths (Since R2022b)
Scalarize portsVector ports flattened into scalar ports
Max number of I/O pins for FPGA deploymentMaximum number of I/O pins for target FPGA (Since R2022a)
Check for DUT pin count exceeding I/O ThresholdMessage generated when DUT pin count exceeds maximum number of I/O pins (Since R2023a)

Coding style

Represent constant values by aggregatesConstants represented by aggregates
Inline MATLAB Function block codeInline HDL code for MATLAB Function blocks
Initialize all RAM blocksGenerate initial signal value for RAM blocks
RAM ArchitectureRAM architecture with or without clock enable
No-reset registers initializationInitialize registers without reset and mode of initialization
Minimize Intermediate SignalsOptimize HDL code for debuggability or code coverage
Unroll For-Generate LoopsUnroll and omit FOR and GENERATE loops from generated HDL code
Generate Parameterized HDL Code from Masked SubsystemGenerate reusable HDL code for subsystems
Enumerated Type Encoding SchemeEncoding scheme represent enumeration types
Use “rising_edge/falling_edge” style for registersSpecify if generated should code use rising_edge function or falling_edge function
Code ReuseSingle reusable file to represent the subsystem logic (Since R2022a)
Inline VHDL configurationSpecify if generated VHDL code includes inline configurations
Concatenate type safe zerosSyntax for concatenated zeros in generated VHDL code
Generate obfuscated HDL codeSpecify generation of obfuscated HDL code (Since R2020b)
Preserve Bus Structure in the Generated HDL CodeGenerate code with VHDL record or SystemVerilog structure types (Since R2022b)
Indexing for Scalarized Port NamingStarting index for the names of scalarized vector ports (Since R2022a)
Optimize timing controllerTiming controller entity for speed and code size
Timing controller architectureArchitecture of generated timing controller
Use Verilog or SystemVerilog `timescale directivesUse of compiler directives in generated Verilog or SystemVerilog code
Verilog or SystemVerilog timescale specificationTimescale to use in generated Verilog or SystemVerilog code

Coding standards

HDL coding standardEnable the Industry coding standard guidelines
Show passing rules in coding standard reportFilter the coding standard report so passing rules do not appear (Since R2020b)
Check for duplicate namesCheck for duplicate names in the design (Since R2020b)
Check for HDL keywords in design namesCheck for HDL keywords in design names (Since R2020b)
Check module, instance, entity name lengthSpecify whether to check module, instance, and entity name length (Since R2020b)
Check signal, port, and parameter name lengthSpecify whether to check signal, port, and parameter name length (Since R2020b)
Check for clock enable signalsSpecify whether to check for clock enable signals in the generated code (Since R2020b)
Detect usage of reset signalsSpecify whether to check for reset signals in the generated code (Since R2020b)
Detect usage of asynchronous reset signalsSpecify whether to check for asynchronous reset signals in the generated code (Since R2020b)
Minimize use of variablesSpecify whether to minimize use of variables (Since R2020b)
Check for initial statements that set RAM initial valuesSpecify whether to check for initial statements that set RAM initial values (Since R2020b)
Check for conditional statements in processesSpecify whether to check for length of conditional statements (Since R2020b)
Check for assignments to the same variable in multiple cascaded control regionsSpecify whether to check if there are assignments to same variable in multiple cascaded control regions (Since R2021b)
Check if-else statement chain lengthSpecify whether to check if-else statement chain length (Since R2020b)
Check if-else statement nesting depthSpecify whether to check if-else statement nesting depth (Since R2020b)
Check multiplier widthSpecify whether to check multiplier bit width (Since R2020b)
Check for non-integer constantsSpecify whether to check for non-integer constants (Since R2020b)
Check line lengthSpecify whether to check line lengths in the generated HDL code (Since R2020b)

Comments

Enable CommentsEnable or disable comments
Comment in headerComment lines in header of generated HDL and test bench files
Emit Time/Date Stamp in HeaderTime and date information in the generated HDL file header
Include Requirements in Block CommentsGeneration of requirements comments
Custom File Header CommentCustom file header comment
Custom File Footer CommentCustom file footer comment

Model Generation

Generated modelEnable or disable generation of generated model
Validation modelEnable or disable generation of a validation model
Suffix for validation model nameSuffix of the validation model name (Since R2020b)
Prefix for generated model namePrefix of the generated model name
Layout StyleLayout style of the generated HDL model (Since R2021b)
Auto signal routingAutomatic routing of signals in the generated model (Since R2020b)
Inter-block horizontal scalingHorizontal scaling of generated model (Since R2020b)
Inter-block vertical scalingVertical scaling of generated model (Since R2020b)

Advanced

Check for name conflicts in black box interfacesSpecify whether to check for duplicate module or entity names
Check for presence of reals in generated HDL codeSpecify whether to check for reals in the generated HDL code
Generate HDL codeEnable or disable HDL code generation for model or Subsystem
Suppress out of bounds access errors by generating simulation-only index checksLogic that runs during simulation time to prevent array indices from going out of bounds (Since R2022a)
Generate traceability reportGenerate report with hyperlinks from code to model and model to code
Traceability styleDesignation of line-level or comment-based traceability (Since R2020b)
Generate model Web viewWeb view to navigate between code and model
Generate resource utilization reportGenerate report with resource utilization information
Generate optimization reportGenerate report about impacts of HDL Coder optimizations
Generate high-level timing critical path reportGenerate a report that shows estimated critical path in models
Custom Timing Database DirectoryPath to load custom timing (Since R2021b)
Simulation toolSimulator for running generated test benches
HDL code coverageEnable or disable HDL code coverage flags in generated simulator scripts
HDL test benchEnable or disable HDL test bench generation
Cosimulation modelEnable or disable generation of cosimulation model
SystemVerilog DPI test benchEnable or disable SystemVerilog DPI test bench generation
Test bench name postfixSpecify suffix appended to test bench name
Force clockSpecify whether the test bench forces clock input signals
Clock high time (ns)Specify the period, in nanoseconds, during which the test bench drives clock input signals high (1)
Clock low time (ns)Specify the period, in nanoseconds, during which the test bench drives clock input signals low (0)
Hold time (ns)Specify a hold time, in nanoseconds, for input signals and forced reset input signals
Setup time (ns)Display setup time for data input signals
Force clock enableSpecify whether the test bench forces clock enable input signals
Clock enable delay (in clock cycles)Define elapsed time (in clock cycles) between deassertion of reset and assertion of clock enable
Force resetSpecify whether the test bench forces reset input signals
Reset length (in clock cycles)Define length of time (in clock cycles) during which reset is asserted
Hold input data between samplesSpecify how long subrate signal values are held in valid state
Initialize test bench inputsSpecify initial value driven on test bench inputs before data is asserted to DUT
Multi-file test benchDivide generated test bench into helper functions, data, and HDL test bench code files
Test bench data file name postfixSpecify suffix added to test bench data file name when generating multi-file test bench
Test bench reference postfixSpecify character vector to be appended to names of reference signals generated in test bench code
Use file I/O to read/write test bench dataCreate and use data files for reading and writing test bench input and output data
Ignore output data checking (number of samples)Specify number of samples during which output data checking is suppressed
Floating point tolerance check based onSpecify the floating-point tolerance check option
Tolerance ValueEnter the tolerance value based on the floating-point tolerance check setting that you specify
Simulation library pathSpecify the path to your compiled Altera or Xilinx simulation libraries
Generate EDA scriptsScript files for third-party electronic design automation (EDA) tools
Compile file postfixPostfix to append to the DUT or test bench name to form the compilation script file name
Compile initializationFormat name used to write the Init section of the compilation script
Compile command for VHDLFormat name used to write the Cmd section of the compilation script
Compile command for Verilog or SystemVerilogFormat name used to write the Cmd section of the compilation script
Compile terminationFormat name used to write the termination portion of the compilation script
Simulation file postfixPostfix to append to the DUT or test bench name
Simulation initializationFormat name used to write the initialization section of the simulation script
Simulation commandFormat name used to write the simulation command
Simulation waveform viewing commandWaveform viewing command written to simulation script
Simulation terminationFormat name used to write the termination portion of the simulation script
Simulator flagsSimulator flags to apply to generated compilation scripts
Choose synthesis toolGeneration of synthesis scripts
Synthesis file postfixPostfix to append to file name
Synthesis initializationFormat name used to write initialization section of synthesis script
Synthesis commandFormat name used to write the synthesis command
Synthesis terminationFormat name that is used to write termination portion of synthesis script
Additional files to add to synthesis projectAdditional HDL or constraint files
Choose HDL lint toolGeneration of an HDL lint script
Lint initializationInitialization text
Lint commandCommand for HDL lint script
Lint terminationTermination character vector

Topics

Using HDL Workflow Advisor

Using Model Configuration Parameters Dialog Box

Model Configuration Parameters