procedure driving signal

eko

Joined
Apr 16, 2008
Messages
12
Reaction score
0
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:
Joined
Mar 10, 2008
Messages
348
Reaction score
0
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
 

eko

Joined
Apr 16, 2008
Messages
12
Reaction score
0
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

Joined
Apr 16, 2008
Messages
12
Reaction score
0
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...:(
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top