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 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
James Price
le 10 Jan 2019
Commenté : Sreejith Menon
le 14 Jan 2019
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.
0 commentaires
Réponse acceptée
Sreejith Menon
le 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 commentaires
Sreejith Menon
le 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
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Speed Optimization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!