dlhdl.ProcessorConfig.setModuleProperty - Use the setModuleProperty method to set properties of modules

  within the dlhdl.ProcessorConfig object - MATLAB ([original](https://www.mathworks.com/help/deep-learning-hdl/ref/dlhdl.processorconfig.setmoduleproperty.html)) ([raw](?raw))

Class: dlhdl.ProcessorConfig
Namespace: dlhdl

Use the setModuleProperty method to set properties of modules within the dlhdl.ProcessorConfig object

Since R2020b

Syntax

setModuleProperty(processorConfigObject,ModuleName,Name,Value)

Description

ThesetModuleProperty([processorConfigObject](#mw%5Ffbe20c24-e092-4636-898f-a3c65d2aa206%5Fsep%5Fmw%5F4aaceff3-0437-4357-96fe-ca0f4d3de873),[ModuleName](#mw%5F45881c19-25e5-4c3b-b76d-eaaf8b1c45cb),[Name,Value](#namevaluepairarguments)) method sets the properties of the module mentioned in ModuleName by using the values specified as Name,Value pairs.

Input Arguments

expand all

Processor configuration, specified as adlhdl.ProcessorConfig object.

The dlhdl.ProcessorConfig object module name, specified as a character vector or string.

Name-Value Arguments

expand all

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example:

conv module parameters

expand all

Use this parameter to control generation of the convolution module as a part of the deep learning processor configuration.

Example: 'ModuleGeneration', 'on'

Use this parameter to control generation of the LRN block as a part of the convolution module of the deep learning processor configuration.

Example: 'LRNBlockGeneration', 'on'

Use this parameter to control generation of the segmentation block as a part of the convolution module of the deep learning processor configuration.

Option to enable or disable Gaussian error linear unit (GELU) block, specified as a character vector.

This parameter is the number of parallel 3-by-3 convolution kernel threads that are a part of the conv module within thedlhdl.ProcessorConfig object.

Example: 'ConvThreadNumber', 64

This parameter is a 3D matrix representing input image size limited by theconv module BRAM size within thedlhdl.ProcessorConfig object.

Example: 'InputMemorySize', [227 227 3]

This parameter is a 3D matrix representing output image size limited by theconv module BRAM size within thedlhdl.ProcessorConfig object.

Example: 'OutputMemorySize', [227 227 3]

This parameter is a positive integer representing the maximum input and output feature size as a part of the conv module within thedlhdl.ProcessorConfig object.

Example: 'FeatureSizeLimit', 512

fc module parameters

expand all

Use this parameter to control generation of the fully connected module as a part of the deep learning processor configuration.

Example: 'ModuleGeneration', 'on'

Use this parameter to control generation of the Softmax block as a part of the fully connected module of the deep learning processor configuration. When you set this property to off, the Softmax layer is still implemented in software.

Example: 'SoftmaxBlockGeneration', 'on'

Option to enable or disable Gaussian error linear unit (GELU) block, specified as a character vector.

This parameter is the number of parallel fc MAC threads that are a part of thefc module within the dlhdl.ProcessorConfig object.

Example: 'FCThreadNumber', 16

This parameter is an unsigned integer representing cache BRAM size limited by thefc module BRAM size within thedlhdl.ProcessorConfig object.

Example: 'InputMemorySize', 9216

This parameter is an unsigned integer representing cache BRAM size limited by thefc module BRAM size within thedlhdl.ProcessorConfig object.

Example: 'OutputMemorySize', 4096

custom module properties

expand all

Use this parameter to control generation of the adder module as a part of the deep learning processor configuration.

Example: 'ModuleGeneration', 'on'

Use this parameter to control generation of the addition layer as a part of the custom module of the deep learning processor configuration.

Use this parameter to control generation of the mish layer as a part of the custom module of the deep learning processor configuration.

Use this parameter to control generation of the multiplication layer as a part of the custom module of the deep learning processor configuration.

Use this parameter to control generation of the resize2d layer as a part of the custom module of the deep learning processor configuration.

Use this parameter to control generation of the sigmoid layer as a part of the custom module of the deep learning processor configuration.

Use this parameter to control generation of the swish layer as a part of the custom module of the deep learning processor configuration.

Use this parameter to control generation of the tanh layer as a part of the custom module of the deep learning processor configuration.

This parameter is an unsigned integer representing cache BRAM size limited by theadder module BRAM size within thedlhdl.ProcessorConfig object.

Example: 'InputMemorySize', 40

This parameter is an unsigned integer representing cache BRAM size limited by theadder module BRAM size within thedlhdl.ProcessorConfig object.

Example: 'OutputMemorySize', 40

Examples

expand all

  1. Create an example object by using the dlhdl.ProcessorConfig class, and then use the setModuleProperty method to set the value forconvThreadNumber.
    hPC = dlhdl.ProcessorConfig;
    hPC.setModuleProperty("conv","ConvThreadNumber",25)
    hPC

  2. Once you execute the code, the result is:
    hPC =
    Processing Module "conv"
    ModuleGeneration: 'on'
    LRNBlockGeneration: 'off'
    SegmentationBlockGeneration: 'on'
    GELUBlockGeneration: 'off'
    ConvThreadNumber: 25
    InputMemorySize: [227 227 3]
    OutputMemorySize: [227 227 3]
    FeatureSizeLimit: 2048
    Processing Module "fc"
    ModuleGeneration: 'on'
    SoftmaxBlockGeneration: 'off'
    GELUBlockGeneration: 'off'
    FCThreadNumber: 4
    InputMemorySize: 25088
    OutputMemorySize: 4096
    Processing Module "custom"
    ModuleGeneration: 'on'
    Addition: 'on'
    MishLayer: 'off'
    Multiplication: 'on'
    Resize2D: 'off'
    Sigmoid: 'off'
    SwishLayer: 'off'
    TanhLayer: 'off'
    InputMemorySize: 40
    OutputMemorySize: 120
    Processor Top Level Properties
    RunTimeControl: 'register'
    RunTimeStatus: 'register'
    InputStreamControl: 'register'
    OutputStreamControl: 'register'
    SetupControl: 'register'
    ProcessorDataType: 'single'
    UseVendorLibrary: 'on'
    LayerNormalizationBlock: 'off'
    System Level Properties
    TargetPlatform: 'Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit'
    TargetFrequency: 200
    SynthesisTool: 'Xilinx Vivado'
    ReferenceDesign: 'AXI-Stream DDR Memory Access : 3-AXIM'
    SynthesisToolChipFamily: 'Zynq UltraScale+'
    SynthesisToolDeviceName: 'xczu9eg-ffvb1156-2-e'
    SynthesisToolPackageName: ''
    SynthesisToolSpeedValue: ''

  3. Create an example object by using the dlhdl.ProcessorConfig class, and then use the setModuleProperty method to set the value forInputMemorySize.
    hPC = dlhdl.ProcessorConfig;
    hPC.setModuleProperty("fc","InputMemorySize",25060)
    hPC

  4. Once you execute the code, the result is:
    hPC =
    Processing Module "conv"
    ModuleGeneration: 'on'
    LRNBlockGeneration: 'off'
    SegmentationBlockGeneration: 'on'
    GELUBlockGeneration: 'off'
    ConvThreadNumber: 16
    InputMemorySize: [227 227 3]
    OutputMemorySize: [227 227 3]
    FeatureSizeLimit: 2048
    Processing Module "fc"
    ModuleGeneration: 'on'
    SoftmaxBlockGeneration: 'off'
    GELUBlockGeneration: 'off'
    FCThreadNumber: 4
    InputMemorySize: 25060
    OutputMemorySize: 4096
    Processing Module "custom"
    ModuleGeneration: 'on'
    Addition: 'on'
    MishLayer: 'off'
    Multiplication: 'on'
    Resize2D: 'off'
    Sigmoid: 'off'
    SwishLayer: 'off'
    TanhLayer: 'off'
    InputMemorySize: 40
    OutputMemorySize: 120
    Processor Top Level Properties
    RunTimeControl: 'register'
    RunTimeStatus: 'register'
    InputStreamControl: 'register'
    OutputStreamControl: 'register'
    SetupControl: 'register'
    ProcessorDataType: 'single'
    UseVendorLibrary: 'on'
    LayerNormalizationBlock: 'off'
    System Level Properties
    TargetPlatform: 'Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit'
    TargetFrequency: 200
    SynthesisTool: 'Xilinx Vivado'
    ReferenceDesign: 'AXI-Stream DDR Memory Access : 3-AXIM'
    SynthesisToolChipFamily: 'Zynq UltraScale+'
    SynthesisToolDeviceName: 'xczu9eg-ffvb1156-2-e'
    SynthesisToolPackageName: ''
    SynthesisToolSpeedValue: ''

  5. Create an example object by using the dlhdl.ProcessorConfig class, and then use the setModuleProperty method to set the value forInputMemorySize.
    hPC = dlhdl.ProcessorConfig;
    hPC.setModuleProperty("custom","InputMemorySize",80)
    hPC

  6. Once you execute the code, the result is:
    hPC =
    Processing Module "conv"
    ModuleGeneration: 'on'
    LRNBlockGeneration: 'off'
    SegmentationBlockGeneration: 'on'
    GELUBlockGeneration: 'off'
    ConvThreadNumber: 16
    InputMemorySize: [227 227 3]
    OutputMemorySize: [227 227 3]
    FeatureSizeLimit: 2048
    Processing Module "fc"
    ModuleGeneration: 'on'
    SoftmaxBlockGeneration: 'off'
    GELUBlockGeneration: 'off'
    FCThreadNumber: 4
    InputMemorySize: 25088
    OutputMemorySize: 4096
    Processing Module "custom"
    ModuleGeneration: 'on'
    Addition: 'on'
    MishLayer: 'off'
    Multiplication: 'on'
    Resize2D: 'off'
    Sigmoid: 'off'
    SwishLayer: 'off'
    TanhLayer: 'off'
    InputMemorySize: 80
    OutputMemorySize: 120
    Processor Top Level Properties
    RunTimeControl: 'register'
    RunTimeStatus: 'register'
    InputStreamControl: 'register'
    OutputStreamControl: 'register'
    SetupControl: 'register'
    ProcessorDataType: 'single'
    UseVendorLibrary: 'on'
    LayerNormalizationBlock: 'off'
    System Level Properties
    TargetPlatform: 'Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit'
    TargetFrequency: 200
    SynthesisTool: 'Xilinx Vivado'
    ReferenceDesign: 'AXI-Stream DDR Memory Access : 3-AXIM'
    SynthesisToolChipFamily: 'Zynq UltraScale+'
    SynthesisToolDeviceName: 'xczu9eg-ffvb1156-2-e'
    SynthesisToolPackageName: ''
    SynthesisToolSpeedValue: ''

  7. Create an example object by using the dlhdl.ProcessorConfig class, and then use the setModuleProperty method to set the value forModuleGeneration.
    hPC = dlhdl.ProcessorConfig;
    hPC.setModuleProperty("conv","ModuleGeneration", "off")
    hPC

  8. Once you execute the code, the result is:
    hPC =
    Processing Module "conv"
    ModuleGeneration: 'off'
    Processing Module "fc"
    ModuleGeneration: 'on'
    SoftmaxBlockGeneration: 'off'
    GELUBlockGeneration: 'off'
    FCThreadNumber: 4
    InputMemorySize: 25088
    OutputMemorySize: 4096
    Processing Module "custom"
    ModuleGeneration: 'on'
    Addition: 'on'
    MishLayer: 'off'
    Multiplication: 'on'
    Resize2D: 'off'
    Sigmoid: 'off'
    SwishLayer: 'off'
    TanhLayer: 'off'
    InputMemorySize: 40
    OutputMemorySize: 120
    Processor Top Level Properties
    RunTimeControl: 'register'
    RunTimeStatus: 'register'
    InputStreamControl: 'register'
    OutputStreamControl: 'register'
    SetupControl: 'register'
    ProcessorDataType: 'single'
    UseVendorLibrary: 'on'
    LayerNormalizationBlock: 'off'
    System Level Properties
    TargetPlatform: 'Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit'
    TargetFrequency: 200
    SynthesisTool: 'Xilinx Vivado'
    ReferenceDesign: 'AXI-Stream DDR Memory Access : 3-AXIM'
    SynthesisToolChipFamily: 'Zynq UltraScale+'
    SynthesisToolDeviceName: 'xczu9eg-ffvb1156-2-e'
    SynthesisToolPackageName: ''
    SynthesisToolSpeedValue: ''

Version History

Introduced in R2020b