VHDL Testbench representation

J

JSreeniv

Hi all,

Could anyone give the response on this..

I am writing VHDL testbench for my code. And i am stuck at the writing
testbench piece...here is the description

WAIT FOR 5 us

Repeat READ(Address) for every 1 us

Where the READ process should be repeat for 5 times..
Can anyone give me the ideas to write the code for this piece of
description

Sreeni
 
K

KJ

Hi all,

Could anyone give the response on this..

I am writing VHDL testbench for my code. And i am stuck at the writing
testbench piece...here is the description

WAIT FOR 5 us

Repeat READ(Address) for every 1 us

Where the READ process should be repeat for 5 times..
Can anyone give me the ideas to write the code for this piece of
description

The 'read process' should probably be a 'read procedure' that gets
invoked within a process within your testbench. Something like the
following...needs more work, but it's a sketch of the overall
structure

entity testbench is
end testbench;

architecture RTL of testbench is
signal Sim_In_Progress: Boolean;

begin
process main
procedure read(Address: integer) is
begin
-- fill in your procedure code here
end procedure read;
begin
wait for 5 us;
while Sim_In_Progress loop
read(Address => 10); -- Example
wait for 1 us;
end loop;
end process;

Sim_In_Progress <= '1', '0' after 10 ms; -- However you want it to
be controlled
end RTL;

Kevin Jennings
 
K

KJ

On Aug 16, 2:13 am, JSreeniv <[email protected]> wrote:

Just noticed that you wanted the reading to happen only 5 times. So
instead of this...

while Sim_In_Progress loop
read(Address => 10); -- Example
wait for 1 us;
end loop;

You would want to have this...
for i in 1 to 5 loop
read(Address => 10); -- Example
wait for 1 us;
end loop;

Kevin Jennings
 

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

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top