Altera_Forum
Honored Contributor
13 years agoVHDL integer causing RTL and Gate level simulation difference
I have a general question regarding the use of integers in VHDL.
If I have a lot of Array defined, we have to use integer as its index when accessing the arrays. However, when the index is converted from std_logic_vectors, it masked away the 'X' values, which masked my signal initiailization problem. Can anybody please let me know how to avoid this problem? When running simulation, I have the following warning: # ** Warning: NUMERIC_STD.TO_INTEGER: metavalue deteced, returning 0 The code example is below: SIGNAL a : ARRAY (INTEGER 0 TO 15) of STD_LOGIC_VECTOR(5 DOWNTO 0); SIGNAL b : STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL c : STD_LOGIC_VECTOR(5 DOWNTO 0); c <= a(TO_INTEGER(UNSIGNED(b));