Loops for write access

Discussion in 'VHDL' started by JSreeniv, Aug 17, 2009.

  1. JSreeniv

    JSreeniv Guest

    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
    JSreeniv, Aug 17, 2009
    #1
    1. Advertising

  2. JSreeniv

    JimLewis Guest

    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
    JimLewis, Aug 17, 2009
    #2
    1. Advertising

  3. JSreeniv

    JSreeniv Guest

    On Aug 17, 9:07 pm, JimLewis <> 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
    JSreeniv, Aug 17, 2009
    #3
  4. JSreeniv

    Andy Guest

    On Aug 17, 11:19 am, JSreeniv <> wrote:
    > On Aug 17, 9:07 pm, JimLewis <> 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
    Andy, Aug 17, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Saurabh Saxena

    can we write program without loops

    Saurabh Saxena, Feb 5, 2004, in forum: C Programming
    Replies:
    22
    Views:
    713
    Peter Pichler
    Feb 22, 2004
  2. =?Utf-8?B?TWFuaXNoIFNhd2ppYW5p?=

    Using loops <TD><%= Response.write("Data")%> </TD>...

    =?Utf-8?B?TWFuaXNoIFNhd2ppYW5p?=, Oct 14, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    670
    sloan
    Oct 15, 2006
  3. .Net Sports
    Replies:
    3
    Views:
    318
    Aaron [SQL Server MVP]
    Mar 17, 2005
  4. Me
    Replies:
    2
    Views:
    237
  5. Replies:
    18
    Views:
    180
    Dr.Ruud
    Oct 10, 2008
Loading...

Share This Page