Usage of Matlab 2017b: Import filename of Simulink-Model into generated HDL-file (usage of HDL-coder)
조회 수: 2 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
Stefanie Schwarz
2022년 8월 4일
편집: Stefanie Schwarz
2022년 12월 20일
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
Stefanie Schwarz
2022년 12월 20일
Since R2021b, timestamp macros (__DATE__, __TIME__, __TIMESTAMP__) are available for custom header file comments with HDL Coder:
참고 항목
카테고리
Help Center 및 File Exchange에서 HDL Verifier에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!