makehdl

Generate HDL RTL code from model, subsystem, or model reference

Syntax

Description

example

makehdl(dut) generates HDL code from the specified DUT model, subsystem, or model reference.

example

makehdl(dut,Name,Value) generates HDL code from the specified DUT model, subsystem, or model reference with options specified by one or more name-value pair arguments.

Examples

collapse all

Generate VHDL® code for the current model.

Generate HDL code for the current model with code generation options set to default values.

makehdl(bdroot)

The generated VHDL code is saved in the hdlsrc folder.

Generate Verilog® for the subsystem symmetric_fir within the model sfir_fixed.

Open the sfir_fixed model.

sfir_fixed;

The model opens in a new Simulink® window.

Generate Verilog for the symmetric_fir subsystem.

makehdl('sfir_fixed/symmetric_fir','TargetLanguage','Verilog')
### Generating HDL for 'sfir_fixed/symmetric_fir'.
### Starting HDL check.
### HDL check for 'sfir_fixed' complete with 0 errors, 0 warnings, 
    and 0 messages.
### Begin Verilog Code Generation for 'sfir_fixed'.
### Working on sfir_fixed/symmetric_fir as 
    hdlsrc\sfir_fixed\symmetric_fir.v
### HDL code generation complete.

The generated Verilog code for the symmetric_fir subsystem is saved in hdlsrc\sfir_fixed\symmetric_fir.v.

Close the model.

bdclose('sfir_fixed');

Check that the subsystem symmetric_fir is compatible with HDL code generation, then generate HDL.

Open the sfir_fixed model.

sfir_fixed;

The model opens in a new Simulink window.

Check the symmetric_fir subsystem for compatibility with HDL code generation. Generate code with code generation options set to default values.

makehdl('sfir_fixed/symmetric_fir','CheckHDL','on')

The generated VHDL code for the symmetric_fir subsystem is saved in hdlsrc\sfir_fixed\symmetric_fir.vhd.

Close the model.

bdclose('sfir_fixed');

Input Arguments

collapse all

Specified as subsystem name, top-level model name, or model reference name with full hierarchical path.

Example: 'top_level_name'

Example: 'top_level_name/subsysA/subsysB/codegen_subsys_name'

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: ‘TargetLanguage','Verilog'

Basic Options

collapse all

For more information, see TargetLanguage.

For more information, see TargetDirectory.

For more information, see CheckHDL.

For more information, see GenerateHDLCode.

For more information, see SplitEntityArch.

For more information, see UseSingleLibrary.

For more information, see Verbosity.

Report Generation

collapse all

For more information, see HDLCodingStandard.

For more information, see HDLCodingStandardCustomizations.

For more information, see Traceability.

For more information, see ResourceReport.

For more information, see OptimizationReport.

For more information, see GenerateWebview.

Speed and Area Optimization

collapse all

For more information, see BalanceDelays.

For more information, see DistributedPipeliningPriority.

For more information, see HierarchicalDistPipelining.

For more information, see PreserveDesignDelays.

For more information, see ClockRatePipelining.

For more information, see MaxOversampling.

For more information, see MaxComputationLatency.

For more information, see MinimizeClockEnables.

The minimum RAM size required for mapping to RAMs instead of registers, specified in bits.

For more information, see RAMMappingThreshold.

For more information, see MapPipelineDelaysToRAM.

For more information, see HighlightFeedbackLoops.

For more information, see HighlightFeedbackLoopsFile.

Coding Style

collapse all

For more information, see UserComment.

For more information, see UseAggregatesForConst.

For more information, see UseRisingEdge.

For more information, see LoopUnrolling.

For more information, see UseVerilogTimescale.

For more information, see InlineConfigurations.

For more information, see SafeZeroConcat.

For more information, see DateComment.

For more information, see ScalarizePorts.

For more information, see MinimizeIntermediateSignals.

For more information, see RequirementComments.

For more information, see InlineMATLABBlockCode.

For more information, see MaskParameterAsGeneric.

For more information, see InitializeBlockRAM.

For more information, see RAMArchitecture.

For more information, see HandleAtomicSubsystem.

Clocks and Reset

collapse all

For more information, see ClockEdge.

For more information, see ClockInputs.

Frequency of global oversampling clock, specified as an integer multiple of the model's base rate.

For more information, see Oversampling.

For more information, see ResetAssertedLevel.

For more information, see ResetType.

For more information, see TriggerAsClock.

For more information, see TimingControllerArch.

Test Bench

collapse all

For more information, see Verbosity.

Generate an HDL Cosimulation block so you can simulate the DUT in Simulink with an HDL simulator.

For more information, see GenerateCoSimBlock.

Generate a model containing an HDL Cosimulation block for the specified HDL simulator.

For more information, see GenerateCoSimModel.

For more information, see GenerateValidationModel.

For more information, see SimulatorFlags.

For more information, see TestBenchReferencePostFix.

Script Generation

collapse all

For more information, see EDAScriptGeneration.

For more information, see HDLCompileInit.

For more information, see HDLCompileTerm.

For more information, see HDLCompileFilePostfix.

Verilog compilation command, specified as a character vector. The SimulatorFlags name-value pair specifies the first argument, and the module name specifies the second argument.

For more information, see HDLCompileVerilogCmd.

VHDL compilation command, specified as a character vector. The SimulatorFlags name-value pair specifies the first argument, and the entity name specifies the second argument.

For more information, see HDLCompileVHDLCmd.

For more information, see HDLLintTool.

HDL lint initialization name, specified as a character vector. The default is derived from the HDLLintTool name-value pair.

For more information, see HDLLintInit.

HDL lint command, specified as a character vector. The default is derived from the HDLLintTool name-value pair.

For more information, see HDLLintCmd.

HDL lint termination, specified as a character vector. The default is derived from the HDLLintTool name-value pair.

For more information, see HDLLintTerm.

For more information, see HDLSynthTool.

HDL synthesis command, specified as a character vector. The default is derived from the HDLSynthTool name-value pair.

For more information, see HDLSynthCmd.

HDL synthesis script file name postfix, specified as a character vector. The default is derived from the HDLSynthTool name-value pair.

For more information, see HDLSynthFilePostfix.

Initialization for the HDL synthesis script, specified as a character vector. The default is derived from the HDLSynthTool name-value pair.

For more information, see HDLSynthInit.

Termination name for the HDL synthesis script. The default is derived from the HDLSynthTool name-value pair.

For more information, see HDLSynthTerm.

Generated Model

collapse all

For more information, see CodeGenerationOutput.

For more information, see GeneratedModelName.

For more information, see GeneratedModelNamePrefix.

For more information, see HighlightAncestors.

For more information, see HighlightColor.

Synthesis

collapse all

For more information, see SynthesisTool.

For more information, see MulticyclePathInfo.

Port Names and Types

collapse all

Clock enable input port name, specified as a character vector.

For more information, see ClockEnableInputPort.

Clock enable output port name, specified as a character vector.

For more information, see ClockEnableOutputPort.

Clock input port name, specified as a character vector.

For more information, see ClockInputPort.

VHDL inputs can have 'std_logic_vector' or 'signed/unsigned' data type. Verilog inputs must be 'wire'.

For more information, see InputType.

VHDL output can be 'Same as input data type', 'std_logic_vector' or 'signed/unsigned'. Verilog output must be 'wire'.

For more information, see OutputType.

Reset input port name, specified as a character vector.

For more information, see ResetInputPort.

File and Variable Names

collapse all

For more information, see VerilogFileExtension.

For more information, see VHDLFileExtension.

For more information, see VHDLArchitectureName.

For more information, see VHDLLibraryName.

For more information, see SplitEntityFilePostfix.

For more information, see SplitArchFilePostfix.

For more information, see PackagePostfix.

For more information, see HDLMapFilePostfix.

For more information, see BlockGenerateLabel.

For more information, see ClockProcessPostfix.

For more information, see ComplexImagPostfix.

For more information, see ComplexRealPostfix.

For more information, see EntityConflictPostfix.

For more information, see InstanceGenerateLabel.

For more information, see InstancePostfix.

For more information, see InstancePrefix.

For more information, see OutputGenerateLabel.

For more information, see PipelinePostfix.

For more information, see ReservedWordPostfix.

For more information, see TimingControllerPostfix.

For more information, see VectorPrefix.

Prefix for internal clock enable and control flow enable signals, specified as a character vector.

For more information, see EnablePrefix.

Specify a prefix for every module or entity name in the generated HDL code. HDL Coder™ also applies this prefix to generated script file names

For more information, see ModulePrefix.

See Also

|

Was this topic helpful?