Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Vhdl Simili, how to change a signal's value?

Reply
Thread Tools

Vhdl Simili, how to change a signal's value?

 
 
hamboo hamboo is offline
Junior Member
Join Date: Apr 2008
Posts: 1
 
      04-10-2008
Hi,
i'm new to vhdl and i'm using vhdl simili 3.1. I'm trying a simple testbench for a comparator. How can i change the value of a signal during simulation using the program's interface ?
i tried typing in the console : force a 111 '@50', but i got an error.
a is supposed to be a an input signal.

this is the testbench code:
---------------------------------------------------------------------
-- Test Bench for 2-bit Comparator (ESD figure 2.5)
-- by Weijun Zhang, 04/2001
--
-- nine cases are tested here
---------------------------------------------------------------------

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;

entity Comparator_TB is -- entity declaration
end Comparator_TB;

---------------------------------------------------------------------

architecture TB of Comparator_TB is

component Comparator
port( A: in std_logic_vector(1 downto 0);
B: in std_logic_vector(1 downto 0);
less: out std_logic;
equal: out std_logic;
greater: out std_logic
);
end component;

signal A, B: std_logic_vector(1 downto 0):="00";
signal less, equal, greater: std_logic;

begin

Unit: Comparator port map (A, B, less, equal, greater);

process

variable err_cnt: integer :=0;

begin

-- Case 1 (using the loop statement)
A <= "11";
B <= "00";
for i in 0 to 2 loop
wait for 10 ns;
assert (greater='1') report "Comparison Error detected!"
severity error;
if (greater/='1') then
err_cnt:=err_cnt+1;
end if;
B <= B + '1';
end loop;

-- Case 2 (using the loop statement)
A <= "00";
B <= "01";
for i in 0 to 2 loop
wait for 10 ns;
assert (less='1') report "Comparison Error detected!"
severity error;
if (less/='1') then
err_cnt:=err_cnt+1;
end if;
B <= B + '1';
end loop;

-- Case 3
A <= "01";
B <= "01";
wait for 10 ns;
assert (equal='1') report "Comparison Error detected!"
severity error;
if (equal/='1') then
err_cnt:=err_cnt+1;
end if;

-- summary of all the tests
if (err_cnt=0) then
assert false
report "Testbench of Adder completed successfully!"
severity note;
else
assert true
report "Something wrong, try again"
severity error;
end if;

wait;

end process;

end TB;

-------------------------------------------------------------------
configuration CFG_TB of Comparator_TB is
for TB
end for;
end CFG_TB;
--------------------------------------------------------------------

Thank you for your help.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM
A Paradise DNS address change? What change? There was no change. Tony Neville NZ Computing 7 09-22-2006 01:02 PM
multiD-vhdl: Multi Dimensional Arrays (allowing generics on each dimension) for VHDL (including ports) albert.neu@gmail.com VHDL 2 03-21-2006 04:05 PM
what's the difference between VHDL 93 CONCATENATION and VHDL 87 CONCATENATION? walala VHDL 3 09-18-2003 04:17 AM



Advertisments