procedure driving signal

Discussion in 'VHDL' started by eko, Apr 22, 2008.

  1. eko

    eko

    Joined:
    Apr 16, 2008
    Messages:
    12
    Hi,

    I want a procedure to drive a signal that is passed by the calling process:

    procedure drive(signal s: inout integer) is
    begin
    s <= s+1;
    end drive;

    But always end up with an infinite loop...why?

    I suspect s triggering the procedure again and again as it is in the sensitivity list, but this aint quite clear to me...someone to explain?

    And even more interesting any idea how to get this working right?

    Thx

    PS: I am calling these procedures out of a clocked process of a fsm...

    PPS: I declared all signals passed to the procedure inside the package (actually just to make it all easier for future users), now when I declare the signals inside the FSM all works fine. Why?
    Last edited: Apr 22, 2008
    eko, Apr 22, 2008
    #1
    1. Advertising

  2. eko

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    Hi
    In general will a procedure normally be used for generation combinatorial logic - and I believe this should be the case here.
    How ever can't you compare the sensitivity list of a PROCESS with the parameter list of a PROCEDURE

    whould this be for simulation only ?

    Your welcome
    Jeppe
    jeppe, Apr 23, 2008
    #2
    1. Advertising

  3. eko

    eko

    Joined:
    Apr 16, 2008
    Messages:
    12
    Yes, this is for simulation purposes only.
    Actually I wanted to generate a package, that is easiest to use.
    So I thought I would generate a few procedures and declare the manipulated signals in the package as well, so a user would not have to bother with custom types etc.

    So I aimed for something like:
    --include library/package somewhere

    callProcedure1(sig1OfStrangeType1, sig2OfStrangeType2);
    callProcedure2(sig1OfStrangeType1, sig2OfStrangeType2);
    callProcedure3(sig1OfStrangeType1, sig2OfStrangeType2);

    myResult <= callResultFunction(sig1OfStrangeType1, sig2OfStrangeType2);

    However, sig1... and sig2... are needed solely to transport the intermediate results from procedure to procedure...

    Obviously the user has no interest in further details on sig1...&sig2...
    so why bother him with declaration?

    Declaring these sigs in the package itself gives me infinite loops with any assignment I make. Declaring these sigs in the clocked process calling the functions/procedures seems to work fine.

    But why?
    eko, Apr 23, 2008
    #3
  4. eko

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    How about using variables instead as parameters ..
    jeppe, Apr 23, 2008
    #4
  5. eko

    eko

    Joined:
    Apr 16, 2008
    Messages:
    12
    Variables need to be declared inside the procedure. That would not help anything, since I need to transport the intermediate results from procedure to procedure.
    Only signals and constants are allowed package wide. Unfourtunately declaring package-wide signals just lead to the described problem...:(
    eko, Apr 23, 2008
    #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. Andy Peters

    Driving signals from a procedure

    Andy Peters, May 19, 2005, in forum: VHDL
    Replies:
    4
    Views:
    911
    Jonathan Bromley
    May 20, 2005
  2. Michael Pronath
    Replies:
    1
    Views:
    1,158
    Diez B. Roggisch
    Jan 3, 2005
  3. Jack Orenstein

    threading.Thread vs. signal.signal

    Jack Orenstein, Sep 18, 2005, in forum: Python
    Replies:
    0
    Views:
    462
    Jack Orenstein
    Sep 18, 2005
  4. Eli Bendersky
    Replies:
    15
    Views:
    2,904
    Jonathan Bromley
    Apr 28, 2007
  5. Silver
    Replies:
    7
    Views:
    1,352
    Thomas Stanka
    Oct 16, 2007
Loading...

Share This Page