UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
320 Views
Registered: ‎05-11-2018

VHDL 2008 generic packages

Jump to solution

In the attached zip folder are present the following files:

            -in control_interface_lib is present a generic package and a file that instantiate it,

            -in mpp_ip_lib is present a package used by the previous files.

This code is correctly compiled by Vivado 2017.1, giving me no error. On the contrary using the compile of questa 2019_2 I have some errors. Writing to the support they said that my error is due to the fact that in the generic package I call the function to give values to constants before that they are elaborated and that is strange that this code is ok for Viavdo. So I'm wondering if the code is really wrong and if yes why Vivado is compiling correctly the code if it is wrong? Maybe it is not preforming some checks that instead are made by questa simulator?

Thanks in advance for the answer.

0 Kudos
1 Solution

Accepted Solutions
Scholar richardhead
Scholar
260 Views
Registered: ‎08-01-2012

Re: VHDL 2008 generic packages

Jump to solution

Not sure how you got it working in 2017.1, as it is confirmed as not working in 2017.2, and Vivado has pretty poor 2008  support:

https://forums.xilinx.com/t5/Synthesis/How-to-use-generic-packages-as-introduced-in-VHDL-2008/m-p/705147

Only 2019.1 officially supports generic packages:

https://forums.xilinx.com/t5/Synthesis/Availablility-of-UG901-Synthesis-Guide-for-2019-1/m-p/978781

 

But modelsim is correct. You will need to defer the constants because they are in a package:

package some_package is
  constant DEFFERED_CONSTANT : integer;
end package;

package body some_package is
  function some_function return integer is 
  --blah blah

  constant DEFFERED_CONSTANT : integer := some_function;
end package body;

View solution in original post

1 Reply
Scholar richardhead
Scholar
261 Views
Registered: ‎08-01-2012

Re: VHDL 2008 generic packages

Jump to solution

Not sure how you got it working in 2017.1, as it is confirmed as not working in 2017.2, and Vivado has pretty poor 2008  support:

https://forums.xilinx.com/t5/Synthesis/How-to-use-generic-packages-as-introduced-in-VHDL-2008/m-p/705147

Only 2019.1 officially supports generic packages:

https://forums.xilinx.com/t5/Synthesis/Availablility-of-UG901-Synthesis-Guide-for-2019-1/m-p/978781

 

But modelsim is correct. You will need to defer the constants because they are in a package:

package some_package is
  constant DEFFERED_CONSTANT : integer;
end package;

package body some_package is
  function some_function return integer is 
  --blah blah

  constant DEFFERED_CONSTANT : integer := some_function;
end package body;

View solution in original post