VHDL Testbench representation

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

  1. JSreeniv

    JSreeniv Guest

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

  2. JSreeniv

    KJ Guest

    On Aug 16, 2:13 am, JSreeniv <> 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
     
    KJ, Aug 16, 2009
    #2
    1. Advertising

  3. JSreeniv

    KJ Guest

    On Aug 16, 2:25 pm, KJ <> wrote:
    > On Aug 16, 2:13 am, JSreeniv <> 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
     
    KJ, Aug 16, 2009
    #3
    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. Ajeetha Kumari

    Re: VHDL testbench Tutorial?

    Ajeetha Kumari, Jul 2, 2003, in forum: VHDL
    Replies:
    2
    Views:
    13,924
    vipinlal
    Mar 29, 2010
  2. Allan Herriman

    Re: VHDL testbench: read BMP Files?

    Allan Herriman, Aug 21, 2003, in forum: VHDL
    Replies:
    1
    Views:
    5,186
    Allan Herriman
    Aug 21, 2003
  3. Martin Thompson

    Re: VHDL testbench: read BMP Files?

    Martin Thompson, Aug 21, 2003, in forum: VHDL
    Replies:
    0
    Views:
    976
    Martin Thompson
    Aug 21, 2003
  4. Amontec Team, Laurent Gauch

    Re: VHDL testbench: read BMP Files?

    Amontec Team, Laurent Gauch, Aug 21, 2003, in forum: VHDL
    Replies:
    0
    Views:
    756
    Amontec Team, Laurent Gauch
    Aug 21, 2003
  5. Emel
    Replies:
    2
    Views:
    2,649
    Brian Drummond
    Jan 23, 2006
Loading...

Share This Page