Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Loops for write access

Reply
Thread Tools

Loops for write access

 
 
JSreeniv
Guest
Posts: n/a
 
      08-17-2009
Hi all,
I am writing a VHDL Testbench for my simulation...and i got some
complexity to describe the writing data for 25 times.
Where my WRITE Access is
write
(x"02181",x"0000_0001",dsp_ardy,dsp_oe_n,dsp_re_n, dsp_we_n,dsp_ce_n,dsp_d,dsp_a,dsp_clk,por_n,test_f pga_oe,test_en);

Here x"02181" is hexadecimal and x"0000_0001" is data and i need to
write data with increment of address by 1 everytime and also data for
25 times.

Writing each time whole this process can be complex..so i am looking
for any simple idea...

Please suggest me..
Thanks
 
Reply With Quote
 
 
 
 
JimLewis
Guest
Posts: n/a
 
      08-17-2009
Hi Sreenivas,
You can also do this with records. It is a little more
difficult since you must initialize the record signal to
all 'Z', it leaves less stuff in the stimulus generation
portion of the testbench.

Best,
Jim
 
Reply With Quote
 
 
 
 
JSreeniv
Guest
Posts: n/a
 
      08-17-2009
On Aug 17, 9:07*pm, JimLewis <(E-Mail Removed)> wrote:
> Hi Sreenivas,
> You can also do this with records. *It is a little more
> difficult since you must initialize the record signal to
> all 'Z', it leaves less stuff in the stimulus generation
> portion of the testbench.
>
> Best,
> Jim


Hi Jim and Brain,
Where from my question i done using defined variables and a while loop
which is good to use in simulations.
from the WRITE access the address is X"02181" and Data:X"0000_0001"

Here is the piece of code:
stimulus: process
variable m1: std_logic_vector(19 downto 0) = X"02181";
variable n1: std_logic_vector(31 downto 0) = X"0000_0001";
---
---
I:=1;
while(I<=25) loop
WRITE(m1+1, n1+1,dsp_ardy, dsp_oe_n, dsp_re_n, dsp_we_n, dsp_ce_n,
dsp_d,
dsp_a, dsp_clk, por_n, test_fpga_oe, test_en);
I:I+1;
end loop;

where my data is increment of 1 or walkin-1's; So is this good way of
implement for Testbench simulation and efficiency..or please suggest
your inputs

Sreeni
 
Reply With Quote
 
Andy
Guest
Posts: n/a
 
      08-17-2009
On Aug 17, 11:19*am, JSreeniv <(E-Mail Removed)> wrote:
> On Aug 17, 9:07*pm, JimLewis <(E-Mail Removed)> wrote:
>
> > Hi Sreenivas,
> > You can also do this with records. *It is a little more
> > difficult since you must initialize the record signal to
> > all 'Z', it leaves less stuff in the stimulus generation
> > portion of the testbench.

>
> > Best,
> > Jim

>
> Hi Jim and Brain,
> Where from my question i done using defined variables and a while loop
> which is good to use in simulations.
> from the WRITE access the address is X"02181" and Data:X"0000_0001"
>
> Here is the piece of code:
> stimulus: process
> variable m1: std_logic_vector(19 downto 0) = X"02181";
> variable n1: std_logic_vector(31 downto 0) = X"0000_0001";
> ---
> ---
> I:=1;
> while(I<=25) loop
> WRITE(m1+1, n1+1,dsp_ardy, dsp_oe_n, dsp_re_n, dsp_we_n, dsp_ce_n,
> dsp_d,
> * * * * * *dsp_a, dsp_clk, por_n, test_fpga_oe, test_en);
> I:I+1;
> end loop;
>
> where my data is increment of 1 or walkin-1's; So is this good way of
> implement for Testbench simulation and efficiency..or please suggest
> your inputs
>
> Sreeni


You probably want to "WRITE(m1+I, n1+I,...".

If your while-loop is acting like a for-loop, then use a for-loop,
simulation or not:

for I in 1 to 25 loop
....

Andy
 
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
efficient way to write multiple loops code friend.05@gmail.com Perl Misc 18 10-10-2008 08:51 AM
Using loops <TD><%= Response.write("Data")%> </TD>... =?Utf-8?B?TWFuaXNoIFNhd2ppYW5p?= ASP .Net 3 10-15-2006 03:13 AM
Loops with loops using html-template Me Perl Misc 2 01-12-2006 05:07 PM
Calling include files in response.write, or do while loops .Net Sports ASP General 3 03-17-2005 04:20 AM
can we write program without loops Saurabh Saxena C Programming 22 02-22-2004 02:57 PM



Advertisments