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
HardwareImplementation
property of the associated configuration object. For example:cfg = coder.config('lib'); cfg.HardwareImplementation.ProdHWDeviceType
A 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.HardwareImplementation
object and assign it to acoder.CodeConfig
object or acoder.EmbeddedCodeConfig
object.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
Hardware
property of acoder.EmbeddedCodeConfig
object to acoder.Hardware
object. To create acoder.Hardware
object, usecoder.hardware
. For example:cfg = coder.config('lib'); hw = coder.hardware('Raspberry Pi'); cfg.Hardware = hw;
Version History
Introduced in R2011a