coder.HardwareImplementation
Hardware-specific configuration parameters for C/C++ code generation from MATLAB code
Description
A coder.HardwareImplementation object contains
hardware-specific configuration parameters that codegen uses for
generating a static library, a dynamically linked library, or an executable
program.
To use a coder.HardwareImplementation object, you must associate it
with a configuration object (a coder.CodeConfig object or a coder.EmbeddedCodeConfig object) that you pass to
codegen. To create a
coder.HardwareImplementation object and associate it with a
configuration object, create the configuration object by using coder.config.
Access coder.HardwareImplementation properties in one of these ways:
The
HardwareImplementationproperty of the associated configuration object. For example:cfg = coder.config('lib'); cfg.HardwareImplementation.ProdHWDeviceTypeA dialog box for the associated configuration object. See Access Hardware Implementation Properties with a Dialog Box.
By default, the coder.HardwareImplementation properties specify
characteristics of the MATLAB® host computer. To specify a different device, modify the
ProdHWDeviceType property. The hardware device determines the
values of the other device-specific properties and the properties that you can
change.
Creation
To create a coder.HardwareImplementation object, use coder.config to create a configuration object (a
coder.CodeConfig object or a
coder.EmbeddedCodeConfig object) for generation of standalone
code. When coder.config creates the configuration object, it also
creates a coder.HardwareImplementation object.
coder.config sets the HardwareImplementation
property of the configuration object to the
coder.HardwareImplementation object.
Properties
Examples
Tips
To set the ProdHWDeviceType property, select the device from the
available options by opening a dialog box for the configuration object that refers to
the coder.HardwareImplementation object. See Access Hardware Implementation Properties with a Dialog Box.
Alternative Functionality
You can directly create a
coder.HardwareImplementationobject and assign it to acoder.CodeConfigobject or acoder.EmbeddedCodeConfigobject.hw_cfg = coder.HardwareImplementation; hw_cfg.ProdHWDeviceType = 'AMD->Athlon 64'; cfg = coder.config('lib'); cfg.HardwareImplementation = hw_cfg;
If you install a support package for your hardware, you can customize hardware-specific code generation parameters by setting the
Hardwareproperty of acoder.EmbeddedCodeConfigobject to acoder.Hardwareobject. To create acoder.Hardwareobject, usecoder.hardware. For example:cfg = coder.config('lib'); hw = coder.hardware('Raspberry Pi'); cfg.Hardware = hw;
Version History
Introduced in R2011a