Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - model sim error in my design

 
Thread Tools Search this Thread
Old 07-01-2005, 12:18 PM   #1
Default model sim error in my design


hi
i created a memory like below.and i wrote test bench for that.while doing
simulaton with model sim its giving the error..like below..

Fatal: (vsim-3421) Value -97 is out of range 0 to 255.
# Time: 25 ns Iteration: 0 Process: /mux_mem_tb/mut/line__44 File:
/disk/users2/kasam/hds_projects/Controller/controller/hdl/mux_mem_mux_mem_beh.vhd

AND MY TEST VECTORS ARE LIKE THIS
clk<= '0','1' after 5 ns, '0' after 10 ns,
'1' after 15 ns, '0' after 20 ns,
'1' after 25 ns, '0' after 30 ns,
'1' after 35 ns, '0' after 40 ns,
'1' after 45 ns, '0' after 50 ns,
'1' after 55 ns, '0' after 60 ns,
'1' after 65 ns, '0' after 70 ns,
we<='1' after 4 ns, '0' after 7 ns,
'1' after 24 ns, '0' after 27 ns,
'1' after 34 ns, '0' after 37 ns;

w_addr<= "00000000" after 4 ns,
"10011111" after 24 ns,
"00001111" after 34 ns;

re<='1' after 14 ns, '0' after 17 ns,
'1' after 44 ns, '0' after 47 ns,
'1' after 54 ns, '0' after 57 ns;

r_addr<= "00000000" after 14 ns,
"10011111" after 44 ns,
"00001111" after 54 ns;

data_in <= "000000000000111111111111" after 4 ns,
"111111111111000000000000" after 24 ns,
"111111000000111111000000" after 34 ns;

reset<='1' after 20 ns, '0'after 23 ns;



DESIGN STARTS HERE------------------------

LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
use ieee.std_logic_signed.all;
use work.contr_pak.all;

ENTITY mux_mem IS
generic(addr_width: integer:=8;
data_width: integer :=24);

port(
clk : in std_logic;
reset : in std_logic;
w_addr : in std_logic_vector(addr_width-1 downto 0); --write
address (state bits)
r_addr : in std_logic_vector(addr_width-1 downto 0); -- read
address (state bits)
data_in : in std_logic_vector(data_width-1 downto 0); -- input
dara
data_out : out std_logic_vector(data_width-1 downto 0);
--output data ( input ctrl width

-- incl..no )
we : in std_logic;
re : in std_logic);
END ENTITY mux_mem;

--
ARCHITECTURE mux_mem_beh OF mux_mem Is
type mux_mem is array (integer range <>) of std_logic_vector(data_width-1
downto 0);
signal ram1: mux_mem(0 to (2**addr_width)-1);

begin

process(clk,reset)
begin

if reset = '1' then
data_out <=(others=>'0');

elsif clk'event and clk='1' then
if re = '1' then
data_out <= ram1(conv_integer(r_addr));
-- data_out<= ram1(vect_to_int(r_addr));
--else
-- data_out <= (others=>'0');
end if;

if we = '1' then
ram1(conv_integer(w_addr))<= data_in;
--ram1(vect_to_int(w_addr)) <= data_in;
end if;
end if;

end process;

END ARCHITECTURE mux_mem_beh;


COULD PLS MAIL EM SOME SUGGATIONS FOR MY PROB::
THANK YOU



srinukasam
  Reply With Quote
Old 07-01-2005, 12:54 PM   #2
Timo Alho
 
Posts: n/a
Default Re: model sim error in my design
srinukasam wrote:
> hi
> i created a memory like below.and i wrote test bench for that.while doing
> simulaton with model sim its giving the error..like below..
>
> Fatal: (vsim-3421) Value -97 is out of range 0 to 255.
> # Time: 25 ns Iteration: 0 Process: /mux_mem_tb/mut/line__44 File:
> /disk/users2/kasam/hds_projects/Controller/controller/hdl/mux_mem_mux_mem_beh.vhd
>
> AND MY TEST VECTORS ARE LIKE THIS
> w_addr<= "00000000" after 4 ns,
> "10011111" after 24 ns,
> ...
> DESIGN STARTS HERE------------------------
> ...
> use ieee.std_logic_signed.all;
> ...
> ram1(conv_integer(w_addr))<= data_in;
> ...


I didn't read your desing too carefully so I'm just guessing here.

You have (most likely) defined w_addr to be std_logic_vector. Since you
have included package std_logic_signed, converting std_logic_vector to
integer becomes a signed integer.

Try replacing line
use ieee.std_logic_signed.all;
with line
use ieee.std_logic_unsigned.all;

-timo


Timo Alho
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Physical sythesis tool PALAC is not supported by Formal Verification tool Conf bbiandov Software 0 12-22-2008 05:25 AM
Sewing, Embroidery & SignMaking Software.. embsupply Software 0 10-02-2007 04:29 PM
Sewing, Embroidery & SignMaking Software.. embsupply Software 0 08-14-2007 04:01 PM
network design help....... bunty4u The Lounge 1 04-08-2007 04:39 AM
Re: Reference Material On Server Chassis Design? AG A+ Certification 0 01-30-2004 06:12 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46