ModelSim & Constant

Jan 23, 2005 2 Replies

Hi,



I want to know if it is possible to watch a constant in the Modelsim waveform viewer because I tried to make a model of ROM memory with an array of std_logic_vector but when I adress the array it don't give me the right value (it seem to choose the first or the final one). So I would like to verify if Modelsim put the right value in the memory the declaration of the memory look like this:


--declaration of a memory subtype type TYPE_RAM is array (512 downto 0) of std_logic_vector(7 downto 0);



--declaration of the memory and his contents constant ram1: TYPE_RAM := ( std_logic_vector(to_unsigned(10#1#,8)), std_logic_vector(to_unsigned(10#2#,8)), std_logic_vector(to_unsigned(10#3#,8)), std_logic_vector(to_unsigned(10#0#,8)), others => ("11111111")



);


--read at the adress wanted data_out


^^^^^^^^^^^^^ I dare to say for arrays of any type one will mostly want to declare 0 to 2**N-1 (in your case, 0 to 511). I was having the very same problem a few weeks ago just because of that. I also thed to automaticaly type downto when coding arrays but in this particular category the outcome is clearly not what one wants though it's sintaticaly correct.

HTH.

Elder.

Argh!!

You are right Elder, how stupid I am, baka baka baka!! lol moreover I took exemple from an old file I have done during my last internship and in this file I used 0 to 2xx too Thank You for correcting my error.

Alexis

"Elder Costa" a écrit dans le message de news: snipped-for-privacy@>

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required