test-bench

Discussion in 'VHDL' started by Amit, Dec 15, 2008.

  1. Amit

    Amit Guest

    hello,

    in a vhdl testbench (just learning) I saw a piece of code as:

    w_reset <= '0', '1' after 40ns, '0' after 60ns;

    so far what I have seen is only 1 value assignment .What about this
    case?


    any help is appreciated.
    Amit, Dec 15, 2008
    #1
    1. Advertising

  2. Amit

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    well the easiest way to learn more about this topics will be the interactive book on VHDL - EVITA. Can be found at the net and downloaded (free)

    Jeppe
    jeppe, Dec 15, 2008
    #2
    1. Advertising

  3. Amit

    Amit Guest

    On Dec 15, 12:58 am, Jonathan Bromley <>
    wrote:
    > On Sun, 14 Dec 2008 23:31:40 -0800 (PST), Amit <>
    > wrote:
    >
    >
    >
    > >hello,

    >
    > >in a vhdl testbench (just learning) I saw a piece of code as:

    >
    > >   w_reset <= '0', '1' after  40ns, '0' after 60ns;

    >
    > This kind of signal assignment is known as a "waveform" in
    > VHDL.  It does pretty much what you might expect: drive
    > w_reset to 0 immediately, drive it to 1 at now+40ns,
    > drive it to 0 at now+60ns.  So you get a 20ns pulse on
    > w_reset, lasting from 40ns to 60ns.  You can specify
    > as many transitions as you want in the waveform, but
    > they must be in ascending order of time.
    >
    > Like any signal assignment, you can use this in the
    > procedural code in a process or you can write it
    > stand-alone in the architecture body as a concurrent
    > signal assignment.  Within a process it is done
    > at the moment the flow of execution reaches that
    > statement.  The future assignments are scheduled,
    > and then process execution continues with no delay.
    > If you write it as a concurrent signal assignment
    > it acts as a process on its own, and therefore
    > executes just once at time 0.
    >
    > You can play silly games with concurrent signal
    > assignment to make clock generators:
    >
    >   signal clock: std_logic := '0';
    >   ...
    >   clock <= not clock after 5 ns;
    >
    > But that is fairly hard to understand and I
    > don't really like it.  The best use for
    > a concurrent signal assignment with a waveform
    > is the one you showed: a one-shot pulse generator.
    > --
    > Jonathan Bromley, Consultant
    >
    > DOULOS - Developing Design Know-how
    > VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
    >
    > Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
    > ://www.MYCOMPANY.com
    >
    > The contents of this message may contain personal views which
    > are not the views of Doulos Ltd., unless specifically stated.



    Hello Jonathan,

    Thank you for help me to understand how it works. Just one question:

    You said:
    >If you write it as a concurrent signal assignment
    >it acts as a process on its own, and therefore
    >executes just once at time 0.


    why will it act once? wouldn't that a concurrent statement? so I guess
    it should keep happening as long as other processes are running so
    this statement (out of process) will be executed more than once.

    Am I wrong?

    Regards,
    Amit
    Amit, Dec 15, 2008
    #3
  4. Amit

    Amit Guest

    On Dec 15, 10:10 am, Jonathan Bromley <>
    wrote:
    > On Mon, 15 Dec 2008 09:55:27 -0800 (PST), Amit wrote:
    > >You said:
    > >>If you write [...] a concurrent signal assignment
    > >>it acts as a process on its own, and therefore
    > >>executes just once at time 0.

    >
    > >why will it act once? wouldn't that a concurrent statement? so I guess
    > >it should keep happening as long as other processes are running so
    > >this statement (out of process) will be executed more than once.

    >
    > >Am I wrong?

    >
    > No, you're not completely wrong; but I was right too.
    > I forgot to mention one important detail....
    >
    > Any VHDL concurrent assignment is simply shorthand for a
    > process, sensitive to every signal that appears on the
    > process's right-hand-side expression.  For example:
    >
    > architecture blah of foo is
    >   ...
    > begin
    >   A <= B or C;
    >   ...
    >
    > is shorthand for...
    >
    >   process (B, C)
    >   begin
    >     A <= B or C;
    >   end process;
    >
    > As I'm sure you know, this process...
    > - executes at time 0 from top to bottom
    > - then waits for a change (event) on any signal in
    >   its sensitivity list
    > - then loops around to the top and executes again
    > - and so on, for ever.
    >
    > In fact, the process with its sensitivity list is
    > itself a shorthand for this version...
    >
    >   process -- no sensitivity
    >   begin
    >     A <= B or C;
    >     wait on B, C;  -- wait for change on sensitivity list
    >   end process;
    >
    > The "executes once at time zero" thing happens simply
    > because the sensitivity "wait on" is at the BOTTOM of
    > the process, not at the beginning.
    >
    > This is fine, BUT what happens if there are NO signals
    > in the right-hand side expression?
    >
    >  D <= '1', '0' after 10 ns;
    >
    > This translates into
    >
    >   process -- no sensitivity
    >   begin
    >     D <= '1', '0' after 10 ns;
    >     wait;   -- No sensitivity to wait on!!!!
    >   end process;
    >
    > So, as I said, such a concurrent assignment will
    > execute just once at time zero.  It then freezes
    > forever at the implicit "wait" statement.
    >
    > Hope that clarifies things.
    > --
    > Jonathan Bromley, Consultant
    >
    > DOULOS - Developing Design Know-how
    > VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
    >
    > Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
    > ://www.MYCOMPANY.com
    >
    > The contents of this message may contain personal views which
    > are not the views of Doulos Ltd., unless specifically stated.



    Thanks! that was really helpful!

    Last question (if you don't mind) is not related to this thread.

    I have a software background and currently learning Digital design and
    VHDL. Will that help me in future to get into embedded/digital field?
    what would be a right step in order to get into this field?
    I tried few times but what I really get back is that my background is
    not embedded or hardware design so it seems it is really hard to get
    into digital field.

    Any advice will be appreciated.

    Thanks.
    Amit, Dec 16, 2008
    #4
  5. Amit

    Tricky Guest

    On 16 Dec, 08:06, Amit <> wrote:
    > On Dec 15, 10:10 am, Jonathan Bromley <>
    > wrote:
    >
    >
    >
    > > On Mon, 15 Dec 2008 09:55:27 -0800 (PST), Amit wrote:
    > > >You said:
    > > >>If you write [...] a concurrent signal assignment
    > > >>it acts as a process on its own, and therefore
    > > >>executes just once at time 0.

    >
    > > >why will it act once? wouldn't that a concurrent statement? so I guess
    > > >it should keep happening as long as other processes are running so
    > > >this statement (out of process) will be executed more than once.

    >
    > > >Am I wrong?

    >
    > > No, you're not completely wrong; but I was right too.
    > > I forgot to mention one important detail....

    >
    > > Any VHDL concurrent assignment is simply shorthand for a
    > > process, sensitive to every signal that appears on the
    > > process's right-hand-side expression.  For example:

    >
    > > architecture blah of foo is
    > >   ...
    > > begin
    > >   A <= B or C;
    > >   ...

    >
    > > is shorthand for...

    >
    > >   process (B, C)
    > >   begin
    > >     A <= B or C;
    > >   end process;

    >
    > > As I'm sure you know, this process...
    > > - executes at time 0 from top to bottom
    > > - then waits for a change (event) on any signal in
    > >   its sensitivity list
    > > - then loops around to the top and executes again
    > > - and so on, for ever.

    >
    > > In fact, the process with its sensitivity list is
    > > itself a shorthand for this version...

    >
    > >   process -- no sensitivity
    > >   begin
    > >     A <= B or C;
    > >     wait on B, C;  -- wait for change on sensitivity list
    > >   end process;

    >
    > > The "executes once at time zero" thing happens simply
    > > because the sensitivity "wait on" is at the BOTTOM of
    > > the process, not at the beginning.

    >
    > > This is fine, BUT what happens if there are NO signals
    > > in the right-hand side expression?

    >
    > >  D <= '1', '0' after 10 ns;

    >
    > > This translates into

    >
    > >   process -- no sensitivity
    > >   begin
    > >     D <= '1', '0' after 10 ns;
    > >     wait;   -- No sensitivity to wait on!!!!
    > >   end process;

    >
    > > So, as I said, such a concurrent assignment will
    > > execute just once at time zero.  It then freezes
    > > forever at the implicit "wait" statement.

    >
    > > Hope that clarifies things.
    > > --
    > > Jonathan Bromley, Consultant

    >
    > > DOULOS - Developing Design Know-how
    > > VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

    >
    > > Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
    > > ://www.MYCOMPANY.com

    >
    > > The contents of this message may contain personal views which
    > > are not the views of Doulos Ltd., unless specifically stated.

    >
    > Thanks! that was really helpful!
    >
    > Last question (if you don't mind) is not related to this thread.
    >
    > I have a software background and currently learning Digital design and
    > VHDL. Will that help me in future to get into embedded/digital field?
    > what would be a right step in order to get into this field?
    > I tried few times but what I really get back is that my background is
    > not embedded or hardware design so it seems it is really hard to get
    > into digital field.
    >
    > Any advice will be appreciated.
    >
    > Thanks.


    The problem you have is that a lot of people either learnt the basics
    of digital electronics by programming for older systems, where
    knowledge of how the system worked lead to far more efficient code
    (though Im pretty sure this will still be the case) or learned them in
    an engineering degree, which will be about 3 years of study. Im sure
    you can learn it, but software experience can be a bit of a hinderance
    (the concept of concurrency confuses and scares alot of software
    engineers. Dont even start talking about processes being procedural,
    that will just confuse them even more :) )

    I dont have any advice on what books to go for, Im sure others can
    point some out, but my advise would be to come at any project from the
    top down. Imagine the circuit before you start writing the VHDL, even
    down to the register level. Drawing it may make it easier. Most
    digital designs are pipelines, which is almost the opposite of how
    software is often written, and so a detail design diagram can help
    massivly.
    Tricky, Dec 16, 2008
    #5

  6. > On 16 Dec, 08:06, Amit <> wrote:


    >> I have a software background and currently learning Digital design and
    >> VHDL. Will that help me in future to get into embedded/digital field?


    It is necessary but not sufficient.
    Do some projects.

    >> I tried few times but what I really get back is that my background is
    >> not embedded or hardware design so it seems it is really hard to get
    >> into digital field.


    "embedded" connotes firmware design to me,
    rather than fpga (which is usually considered hardware).
    Firmware is bit level software that updates
    volatile input and output registers
    by polling or by interrupt service.

    Tricky wrote:

    > Im sure
    > you can learn it, but software experience can be a bit of a hinderance
    > (the concept of concurrency confuses and scares alot of software
    > engineers. Dont even start talking about processes being procedural,
    > that will just confuse them even more :) )


    Actually, I have found that some firmware guys take
    to procedural, single process vhdl code.
    It is the port maps and wires that are
    more of struggle.

    -- Mike Treseler
    Mike Treseler, Dec 16, 2008
    #6
  7. Amit

    Amit Guest

    On Dec 16, 8:41 am, Mike Treseler <> wrote:
    > > On 16 Dec, 08:06, Amit <> wrote:
    > >> I have a software background and currently learning Digital design and
    > >> VHDL. Will that help me in future to get into embedded/digital field?

    >
    > It is necessary but not sufficient.
    > Do some projects.
    >
    > >> I tried few times but what I really get back is that my background is
    > >> not embedded or hardware design so it seems it is really hard to get
    > >> into digital field.

    >
    > "embedded" connotes firmware design to me,
    > rather than fpga (which is usually considered hardware).
    > Firmware is bit level software that updates
    > volatile input and output registers
    > by polling or by interrupt service.
    >
    > Tricky wrote:
    > >  Im sure
    > > you can learn it, but software experience can be a bit of a hinderance
    > > (the concept of concurrency confuses and scares alot of software
    > > engineers. Dont even start talking about processes being procedural,
    > > that will just confuse them even more :) )

    >
    > Actually, I have found that some firmware guys take
    > to procedural, single process vhdl code.
    > It is the port maps and wires that are
    > more of struggle.
    >
    >      -- Mike Treseler




    Thanks to all.

    Yes, I guess there is no short cut to it and I have to keep learning
    and keep sending my resume and see what would happen!>

    Merry Christmas everybody.
    Amit, Dec 24, 2008
    #7
    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. Joseph A. Zammit

    Xilinx test bench and user group

    Joseph A. Zammit, Feb 25, 2004, in forum: VHDL
    Replies:
    3
    Views:
    2,143
  2. Pete Fraser
    Replies:
    4
    Views:
    6,762
    Mike Treseler
    Nov 4, 2004
  3. SneakerNet

    VHDL Test Bench + Help

    SneakerNet, Jan 6, 2005, in forum: VHDL
    Replies:
    3
    Views:
    13,849
    vipinlal
    Mar 3, 2010
  4. Massimiliano Bertei

    NEWBIE TEST BENCH HELP?

    Massimiliano Bertei, Jan 19, 2005, in forum: VHDL
    Replies:
    4
    Views:
    585
  5. Teten
    Replies:
    1
    Views:
    817
    Ajeetha
    Sep 3, 2005
Loading...

Share This Page