Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > VHDL Testbench representation

Reply
Thread Tools

VHDL Testbench representation

 
 
JSreeniv
Guest
Posts: n/a
 
      08-16-2009
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
 
Reply With Quote
 
 
 
 
KJ
Guest
Posts: n/a
 
      08-16-2009
On Aug 16, 2:13*am, JSreeniv <(E-Mail Removed)> wrote:
> 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
 
Reply With Quote
 
 
 
 
KJ
Guest
Posts: n/a
 
      08-16-2009
On Aug 16, 2:25*pm, KJ <(E-Mail Removed)> wrote:
> On Aug 16, 2:13*am, JSreeniv <(E-Mail Removed)> 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
 
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: VHDL testbench Tutorial? Ajeetha Kumari VHDL 2 03-29-2010 11:43 AM
Help! Signed Number Representation in Xilinx Testbench Waveform Emel VHDL 2 01-23-2006 01:22 PM
Re: VHDL testbench: read BMP Files? Amontec Team, Laurent Gauch VHDL 0 08-21-2003 02:43 PM
Re: VHDL testbench: read BMP Files? Martin Thompson VHDL 0 08-21-2003 10:57 AM
Re: VHDL testbench: read BMP Files? Allan Herriman VHDL 1 08-21-2003 09:15 AM



Advertisments