Loops for write access

J

JSreeniv

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_fpga_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
 
J

JimLewis

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
 
J

JSreeniv

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
 
A

Andy

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
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top