How are generics supported in HDL Coder?

21 次查看(过去 30 天)
What are the different ways to use GENERIC parameters in HDL Coder?

采纳的回答

MathWorks Support Team
编辑:MathWorks Support Team 2021-10-19
HDL Coder generates parameterized VHDL/Verilog code in the following scenarios:
(1) Use of Model Arguments.
You can use model references and model arguments to generate generic parameters in the generated HDL code for Gain and Constant blocks. The model argument values should resolve to numeric data types at runtime.
(2) Use of Masked Subsystems.
You can generate reusable HDL code for subsystems that have the same tunable mask parameters, but with different values, by enabling 'MaskParameterAsGeneric':
(3) Use of Blackbox Generics.
If you are integrating legacy code using black box subsystem functionality, you can instantiate generic parameters in the module instance using the 'GenericList' parameter:
(4) Use of Address and Data width generics in RAM modules
RAMs are implemented using generic values for address and data widths.
See the attached PDF for an overview.

更多回答(1 个)

Kiran Kintali
Kiran Kintali 2018-2-14
>> web(fullfile(docroot, 'hdlcoder/ref/maskparameterasgeneric.html'))
Please check this page. You can use mask parameters in Gain, Constant blocks and use MaskParametersAsGeneric feature to generate generic parameters in the generated RTL.
If you are using blackbox subsystem functionality you can instantiate generic parameters in the module instance
web(fullfile(docroot, 'hdlcoder/ug/black-box-implementation-for-subsystem-blocks.html'))
In addition model block parameters and RAM instances can also generate generic parameters during code generation.
Please see attached document for details of these use cases.

标签

尚未输入任何标签。

产品


版本

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by