Filter löschen
Filter löschen

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

4 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

Sreejith Menon
Sreejith Menon am 11 Jan. 2019
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 Kommentare
James Price
James Price am 14 Jan. 2019
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 am 14 Jan. 2019
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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by