Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Help needed"test bench of a counter entering a value in fifo and then reading it out"

Status
Not open for further replies.

prady019

Junior Member level 3
Joined
Sep 26, 2012
Messages
29
Helped
1
Reputation
4
Reaction score
1
Trophy points
1,283
Location
India
Activity points
1,477
Help needed"test bench of a counter entering a value in fifo and then reading it out"

this is code i wrote for test bench in vhdl
tell me did i make any mistake or guide me to write it in more simpler form.
i wrote some on my qures in comments form help me out for that.

**********************************************************
entity counter_data_tb is
end counter_data_tb;

architecture test of counter_data_tb is

component top_level
port ( clk : in std_logic;
rst : in std_logic;
write_request_top : in std_logic;
read_request_top : in std_logic;
fifo_out_top : out std_logic_vector(7 downto 0)
);
end component;

signal clk_test : std_logic := '0';
signal rst_test : std_logic := '0';
signal write_request_top_test : std_logic := '0';
signal read_request_top_test : std_logic := '0';
signal fifo_out_top_test : std_logic_vector(7 downto 0);

constant clk_period : time := 2 ns;
begin

DUT : top_level
port map ( clk => clk_test,
rst => rst_test,
write_request_top => write_request_top_test,
read_request_top => read_request_top_test,
fifo_out_top => fifo_out_top_test
);

clk_genrate : process
begin
clk_test <= '0';
wait for clk_period/2;
clk_test <= '1';
wait for clk_period/2;
end process;

input_genrate : process
begin
wait for 2 ns;
rst_test <= '1';
wait for 2 ns;
rst_test <= '0';
wait for 3 ns;
write_request_top_test <= '1'; -- to make read/write request i thought of this, is this write??
read_request_top_test <= '0';
wait for 2 ns;
write_request_top_test <= '0';
read_request_top_test <= '1';
wait for 2 ns;
write_request_top_test <= '1';
read_request_top_test <= '0';
wait for 2 ns;
write_request_top_test <= '0';
read_request_top_test <= '1';
wait for 2 ns;
write_request_top_test <= '1';
read_request_top_test <= '0';
wait for 2 ns;
write_request_top_test <= '0';
read_request_top_test <= '1';
wait for 2 ns;
write_request_top_test <= '1';
read_request_top_test <= '0';
wait for 2 ns;
write_request_top_test <= '0';
read_request_top_test <= '1';
wait for 2 ns;
write_request_top_test <= '1';
read_request_top_test <= '0';
wait for 2 ns;
write_request_top_test <= '0';
read_request_top_test <= '1';
wait for 2 ns;
write_request_top_test <= '1';
read_request_top_test <= '0';
wait for 2 ns;
write_request_top_test <= '0';
read_request_top_test <= '1';
wait; -- tell me what's this statement doing here??
end process;

end test;
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    155.5 KB · Views: 83
  • Untitled.jpg
    Untitled.jpg
    151.6 KB · Views: 76
Last edited:

Re: Help needed"test bench of a counter entering a value in fifo and then reading it

Please upload the clear waveform, left most side labels in your waveform is not completely visible,
 

Last edited:

Re: Help needed&quot;test bench of a counter entering a value in fifo and then reading it

What are you writting at 4th clock pulse, and what are you reading at 5th clock pulse.
 

Re: Help needed&quot;test bench of a counter entering a value in fifo and then reading it

i don't know what i did, but my mind is in real mess now. :(
 

Re: Help needed"test bench of a counter entering a value in fifo and then reading it

First make the counter and then apply to FIFO register
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top