Main Content

coder.config

Create HDL Coder code generation configuration objects

Description

example

config_obj = coder.config('hdl') creates a coder.HdlConfig configuration object for use with the HDL codegen function when generating HDL or High-Level Synthesis (HLS) code from MATLAB® code.

example

config_obj = coder.config('fixpt') creates a coder.FixptConfig configuration object for use with the HDL codegen function when generating HDL code from floating-point MATLAB code. The coder.FixptConfig object configures the floating-point to fixed-point conversion.

Examples

collapse all

Create a coder.FixptConfig object, fixptcfg, with default settings.

fixptcfg = coder.config('fixpt');

Set the test bench name. In this example, the test bench function name is mlhdlc_dti_tb.

fixptcfg.TestBenchName = 'mlhdlc_dti_tb';

Create a coder.HdlConfig object, hdlcfg, with default settings.

hdlcfg = coder.config('hdl');

Convert your floating-point MATLAB design to fixed-point, and generate HDL or HLS code. In this example, the MATLAB design function name is mlhdlc_dti.

codegen -float2fixed fixptcfg -config hdlcfg mlhdlc_dti

Version History

Introduced in R2013a