Usage of Matlab 2017b: Import filename of Simulink-Model into generated HDL-file (usage of HDL-coder)

1 visualización (últimos 30 días)
I use Matlab/Simulink 2017b for HDL code generation from Simulink model.
In HDL coder/Global Settings/File Comment Customization i will insert a 'Custom File Header Comment' for the generated HDL code. I want to import the filename of the simulink-model into the generated hdl code file:
Header of HDL-file (see als attachment)
-- File name: <%Filename%>.vhd
-- Design Unit: <%Filename%>(RTL)
-- DAL-level: A
...
Filename shall be replaced in the header of generated HDL-file from HDL-coder with the file-name of the Simulink model:
Example: File name of Simulink-model: PT1_Filter:
Header of generated HDL-File:
-- File name: PT1_Filter.vhd
-- Design Unit: PT1_Filter(RTL)
-- DAL-level: A
...
It does not work. What is the problem?
Thank you
Josef

Respuestas (1)

Stefanie Schwarz
Stefanie Schwarz el 4 de Ag. de 2022
Editada: Stefanie Schwarz el 20 de Dic. de 2022
In MATLAB R2017b, it is not possible to use macro-style keywords for custom header/footer comments with HDL Coder.
We apologize that the documentation gave the wrong impression that these are macros. We addressed this in the R2021a version of the "File Comment Customization Parameters" doc page.
To adjust the header/footer comment dynamically, use a programmatic approach to generate the HDL Code:
>> hdlset_param(gcs,'CustomFileHeaderComment', ...
['File name: ' gcs '.vhd' newline...
'Design Unit: ' gcs '(RTL)' newline...
'Date: ' datestr(now)]);
>> makehdl(gcs);

Community Treasure Hunt

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

Start Hunting!

Translated by