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

4 vues (au cours des 30 derniers jours)
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

Réponses (1)

Stefanie Schwarz
Stefanie Schwarz le 4 Août 2022
Modifié(e) : Stefanie Schwarz le 20 Déc 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);
  1 commentaire
Stefanie Schwarz
Stefanie Schwarz le 20 Déc 2022
Since R2021b, timestamp macros (__DATE__, __TIME__​, __TIMESTAMP__​) are available for custom header file comments with HDL Coder:

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by