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!

AR# 35607

11.5 XST - Package Constant incorrectly overrides Generic Constant of the same name

Description

Generic is defined in the top level of the VHDL file as follows:

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

LIBRARY work;
USE work.pci_pkg.ALL;

ENTITY vhdl_priority_conflict IS
GENERIC
(
no_of_bar : integer := 3
);
PORT
(
input : IN std_logic_vector((no_of_bar - 1) DOWNTO 0);
output : OUT std_logic_vector((no_of_bar - 1) DOWNTO 0)
);
END vhdl_priority_conflict;

ARCHITECTURE vhdl_priority_conflict_arch OF vhdl_priority_conflict IS

BEGIN

gen_input_to_output : FOR i IN 0 TO (no_of_bar - 1) GENERATE

output(i) <= input(i);

END GENERATE gen_input_to_output;

END vhdl_priority_conflict_arch;



There is a package included with a constant of the same name as follows:

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

PACKAGE pci_pkg IS

TYPE int_array IS array (1 TO 8) OF integer;

CONSTANT no_of_bar : int_array := (2, 0, 0, 0, 0, 0, 0, 0);

END pci_pkg;

PACKAGE BODY pci_pkg IS

END;


When this constant is being resolved, it should be resolved to the generic as opposed to the package constant, but this is not the case.

Solution


To work around this issue, ensure the package constant and generic constant have different names.
For newer architectures (i.e., Virtex-6 and Spartan-6 devices onwards), this issue does not occur. The HDL parser used for these families deals with this correctly.
AR# 35607
Date Created 08/03/2010
Last Updated 12/15/2012
Status Active
Type General Article