waiting on vector change

Discussion in 'VHDL' started by Andy Peters, May 10, 2005.

  1. Andy Peters

    Andy Peters Guest

    A funny thing is happening in my test bench.

    Given an entity with a vector in the list of ports:

    entity foo is
    port (
    in bar : std_logic_vector(7 downto 0);
    ... );
    end entity foo;

    and a greatly-simplified architecture

    architecture bletch of foo is
    begin
    proc : process is
    begin
    wait on bar; -- wait for change
    doSomething;
    end process proc;
    end architecture bletch;

    The problem is that the wait is triggered when the vector bar changes
    from all undriven ('UUUUUUUU') to some reasonable value. Then
    doSomething is called, and then it goes back to waiting for bar to
    change. The higher-level module that uses foo definitely changes bar
    again, and I can see it change in foo, but the process proc is hung and
    apparently doesn't see bar changing.

    My assumption is that this should work but it doesn't. I'm using
    ModelSim XE Starter 5.8c

    Ideas?

    thanks,
    -a
     
    Andy Peters, May 10, 2005
    #1
    1. Advertising

  2. Andy Peters

    Duane Clark Guest

    Andy Peters wrote:
    > A funny thing is happening in my test bench.
    >
    > Given an entity with a vector in the list of ports:
    >
    > entity foo is
    > port (
    > in bar : std_logic_vector(7 downto 0);
    > ... );
    > end entity foo;
    >
    > and a greatly-simplified architecture
    >
    > architecture bletch of foo is
    > begin
    > proc : process is
    > begin
    > wait on bar; -- wait for change
    > doSomething;
    > end process proc;
    > end architecture bletch;
    >
    > The problem is that the wait is triggered when the vector bar changes
    > from all undriven ('UUUUUUUU') to some reasonable value. Then
    > doSomething is called, and then it goes back to waiting for bar to
    > change. The higher-level module that uses foo definitely changes bar
    > again, and I can see it change in foo, but the process proc is hung and
    > apparently doesn't see bar changing.


    You don't appear to have included enough code. Either you need a
    sensitivity list, or you need an inifinite wait in the process.
    Otherwise, Modelsim should give you an error when you attempt to compile
    that. Do you have a sensitivity list that includes bar?
     
    Duane Clark, May 10, 2005
    #2
    1. Advertising

  3. Andy Peters

    Duane Clark Guest

    Duane Clark wrote:
    >
    > You don't appear to have included enough code. Either you need a
    > sensitivity list, or you need an inifinite wait in the process.
    > Otherwise, Modelsim should give you an error when you attempt to compile
    > that. Do you have a sensitivity list that includes bar?


    Hmm.. my bad. Any wait is okay, so ignore that, sorry.
     
    Duane Clark, May 10, 2005
    #3
  4. Andy Peters wrote:

    > The problem is that the wait is triggered when the vector bar changes
    > from all undriven ('UUUUUUUU') to some reasonable value. Then
    > doSomething is called, and then it goes back to waiting for bar to
    > change.


    Maybe bar changes during doSomething;
    instead of during the wait. You only
    have half of a handshake here.

    -- Mike Treseler
     
    Mike Treseler, May 10, 2005
    #4
  5. Andy Peters

    Andy Peters Guest

    > Maybe bar changes during doSomething;
    > instead of during the wait. You only
    > have half of a handshake here.


    Mike,
    That's exactly it. I added a "Busy" flag that the logic must monitor
    and know not to change bar until Busy goes away.
    Thanks,
    -a
     
    Andy Peters, May 10, 2005
    #5
    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. learningjava
    Replies:
    5
    Views:
    2,283
    Miguel De Anda
    Oct 17, 2003
  2. pmatos
    Replies:
    6
    Views:
    23,855
  3. Replies:
    8
    Views:
    1,939
    Csaba
    Feb 18, 2006
  4. Javier
    Replies:
    2
    Views:
    574
    James Kanze
    Sep 4, 2007
  5. Rushikesh Joshi
    Replies:
    0
    Views:
    368
    Rushikesh Joshi
    Jul 10, 2004
Loading...

Share This Page