Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16545 Discussions

Using constants from package on bdf

dsmirnov
New Contributor I
1,224 Views

There were some questions on this forum about constants on  *.bdf, e.g. https://community.intel.com/t5/Intel-Quartus-Prime-Software/Is-a-Quartus-bdf-file-can-access-a-package-in-WORK-library/m-p/134534 

The main problem is that if I would like to use *.bdf as my top-level file and I would like to have the ability to change some parameters I use generic/parameter to make it appear on top-level.

 

Imagine  I would use vhd-file as top-level. I can write such code:

 

 

<...>
library work;

entity process_test is
    generic (
        CCC : INTEGER := work.my_pack.myPar
    );
<...>

 

 

 

 

where my_pack is a package with constant myPar defined. During compilation, Quartus will create a proper scheme with the value of CCC equal to the value of myPar from the package.

While using *.bdf-file I can try to use the same approach:

bdf_constant_question.JPG

 

But while compiling it gets an error.

I can't truly understand why it doesn't see my constants, because it definitely uses work library. However, I can't use any package with constants so they can be assigned to these parameters. Notice, whenever I generate *.vhd-file from any good *.bdf I see one important line:

 

 

library work;

 

which tells me that this file must get all information from work.

Of course, I can use the solution with set_parameter (https://community.intel.com/t5/Intel-Quartus-Prime-Software/Block-Diagram-File-with-Parameters-Generate-VHDL-File-not/td-p/17001) but it doesn't really well for modelling in Modelsim plus it keeps constants only for top-level file, so with deep hierarchy, I can't set values for deep files.

 

Now, the question: is it normal behaviour for *.bdf? Why does it see work library but still doesn't see constants from work? Is there any way to add package on *.bdf?

0 Kudos
5 Replies
RichardTanSY_Intel
1,200 Views

Have you tried the KDB below?  You can try to use the param primitives and constant primitives.

https://www.intel.com/content/www/us/en/programmable/support/support-resources/knowledge-base/solutions/rd06082010_663.html

What is the error shown during the compilation? 

0 Kudos
dsmirnov
New Contributor I
1,191 Views

Dear @RichardTanSY_Intel,

Thank you for your answer. Yes, I tried this solution, but it is uncomfortable:

- it is a graphical info which I can't store in a separate file

- It is hard to keep in git

- I can't use same constant in different layers of files - I have to duplicate this param inside of another bdf

 

The error from the option I showed on image in my question is:

Error (275082): Illegal values "work.my_pack.myPar" for parameter "CCC". The type is "Signed Integer".

I guess that means that the compiler doesn't see my constant myPar from the package my_pack

0 Kudos
RichardTanSY_Intel
1,162 Views

Could you share your design and package so that I could duplicate it from my side? 

0 Kudos
dsmirnov
New Contributor I
1,144 Views

Yes @RichardTanSY_Intel , the project attached to this message

0 Kudos
RichardTanSY_Intel
1,048 Views

Sorry for idling for sometime. The BDF is weak in handling this kind of situation.

My best bet is to write the design in VHDL in the first place. 

0 Kudos
Reply