主要内容

convertToHlsConfig

R2026b

Convert coder.HdlConfig object to coder.HlsConfig object

Since R2026b

Description

hlscfg = convertToHlsConfig(hdlcfg) converts a coder.HdlConfig object to a coder.HlsConfig object. The function transfers the HLS-relevant property values from hdlcfg to the new coder.HlsConfig object. Properties that do not apply to the HLS workflow are not transferred.

example

Examples

collapse all

Create a coder.HdlConfig object and configure it for the HLS workflow.

hdlCfg = coder.config("hdl");
hdlCfg.Workflow = "High Level Synthesis";
hdlCfg.TestBenchName = "myDesign_tb";
hdlCfg.GenerateHDLTestBench = true;

Convert the coder.HdlConfig object to a coder.HlsConfig object.

hlsCfg = convertToHlsConfig(hdlCfg);

Generate HLS code using the converted configuration object.

codegen -config hlsCfg myDesign -report

Input Arguments

collapse all

coder.HdlConfig configuration object, specified as an object created by using coder.config. The Workflow property of the object must be set to "High Level Synthesis".

Example: coder.config("hdl")

Output Arguments

collapse all

coder.HlsConfig configuration object, returned as an object containing the HLS-relevant property values transferred from the input coder.HdlConfig object. Use this object with the codegen function to generate HLS code.

Tips

  • Use convertToHlsConfig to migrate existing scripts that use coder.HdlConfig for HLS code generation. The function transfers only properties that are relevant to the HLS workflow.

  • For new projects, create a coder.HlsConfig object directly by using coder.config("hls") instead of converting from coder.HdlConfig.

Version History

Introduced in R2026b