HDL Code Generation of a system that includes Model References results in the generated code for the referenced model having its name (entity) duplicated.

조회 수: 1 (최근 30일)
If I have a referenced model (e.g. adder) within a design (e.g. DUT); when I generate the code for DUT it contains the expected component instantion in DUT VHDL e.g. u_adder : adder however the generated VHDLfor the adder component is incorrectly named adder_adder.vhd with an enity name adder_adder therefore there is a mismatch in simulation/synthesis.
If you generate the code for adder standalone it will generate the correct filename adder.vhd with enitty name adder.
Please explain how you can generate VHDL code for designs that contain referenced models.

채택된 답변

Sreejith Menon
Sreejith Menon 2019년 1월 11일
Hi James,
HDL Coder adds a prefix for the referenced model in the generated code. The default value of that prefix is the modelname_, where ‘modelname’ is the name of the referenced model. This is the reason for the adder_adder.vhd in your design.
You can always control the prefix using the HDL Block Property - ReferenceModelPrefix. (Right click on the referenced model > HDL Code > HDL Block Properties). If you provide an empty prefix, HDL Coder will not add a prefix to the submodel file name and you will get ‘adder.vhd’ with entity name ‘adder’. But if there are any name collisions between the different models that you use, this can result in compilation errors.
regards,
Sreejith
  댓글 수: 2
James Price
James Price 2019년 1월 14일
Hi Sreejith,
Thanks for your answer, that worked. Is there a way to change the default value of the ModelReferencePrefix to blank as I cannot think of scenario for HDL generation that having a prefix would be required.
Kind regards
James
Sreejith Menon
Sreejith Menon 2019년 1월 14일
Hi James,
The default value is set to modelnameto avoid any name collisions. But you can easily change it to empty prefix using a simple script. ‘find_system’ will help you to find the ModelReference blocks in your design. You can use hdlset_param to set the value of 'ReferenceModelPrefix' to any prefix value. Please refer to our document if you have any doubts.
regards,
Sreejith

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 HDL Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by