Warning in Modelsim - vector truncated

A

ALuPin

Hi,

I am using the following conversion in my code:

--------------------------------------
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

begin
....
ls_rom_rdaddress <=
std_logic_vector(to_unsigned(ls_rom_rdaddress_count, 6));

....
end;

When starting my functional simulation in Modelsim I get the following
warning:

Time: 122565394 ps Iteration: 4 Instance:
/tb_pattern_sequencer/uut1/i_tests
# ** Warning: NUMERIC_STD.TO_UNSIGNED: vector truncated

Can someone explain ?

Thank you for your help.

Rgds
André
 
A

ALuPin

signal ls_rom_rdaddress : std_logic_vector(5 downto 0);
signal ls_rom_rdaddress_count : integer range 0 to 64;


I need the range to go up to 64 to check some condition which has
nothing to do with the ROM read address (which goes up to 63).

Is that truncation a problem ?
 
D

Duane Clark

Hi,

I am using the following conversion in my code:

--------------------------------------
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

begin
...
ls_rom_rdaddress <=
std_logic_vector(to_unsigned(ls_rom_rdaddress_count, 6));

...
end;

When starting my functional simulation in Modelsim I get the following
warning:

Time: 122565394 ps Iteration: 4 Instance:
/tb_pattern_sequencer/uut1/i_tests
# ** Warning: NUMERIC_STD.TO_UNSIGNED: vector truncated

Can someone explain ?

The warnings only come about when the input number is negative. I would
like to see a better solution, but to eliminate the warnings, I did this:
if int_v < 0 then
coeff_data := std_logic_vector(to_unsigned(int_v+65536, 16));
else
coeff_data := std_logic_vector(to_unsigned(int_v, 16));
end if;
Fortunately, I was only using that in a testbench, so I was not
concerned with how it would synthesize.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top