Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Help with procedure

Reply
Thread Tools

Help with procedure

 
 
Willem Oosthuizen
Guest
Posts: n/a
 
      08-20-2003
I use the following code in a process, and it works as intended.

if pci_trdyn /= '0' then
while pci_trdyn /= '0' loop
wait for clock_period;
end loop;
wait for clock_period;
else
wait for clock_period;
end if;

I would like to replace this code with

WaitSig(pci_trdyn ,'0',Clock_Period);

where WaitSig is defined as

procedure WaitSig(Sig,State : in std_logic; Clock_Period : in time) is
begin
if Sig /= State then
while Sig /= State loop
wait for clock_period;
end loop;
wait for clock_period;
else
wait for clock_period;
end if;
end procedure;

This does not work. Why? Is it because signals are not updated dynamically
while a procedure executes?
Is there another mechanism I can use to simplify my code?


 
Reply With Quote
 
 
 
 
Egbert Molenkamp
Guest
Posts: n/a
 
      08-20-2003
I think the problem is the procedure

> procedure WaitSig(Sig,State : in std_logic; Clock_Period : in time) is


This is equal to:
procedure WaitSig( CONSTANT Sig,State : in std_logic; CONSTANT Clock_Period
: in time) is

and you don't want the constant value ("call by value") but since the value
of the signals
are changed when time progress you want probably the actual value ("call by
reference").
Make this explicit as follows:
procedure WaitSig(SIGNAL Sig,State : in std_logic; Clock_Period : in time)
is
(assuming that Clock_period is a constant value, otherwise add SIGNAL to for
'Clock_period')

Egbert Molenkamp

"Willem Oosthuizen" <(E-Mail Removed)> wrote in message
news:bhv98c$mcj$(E-Mail Removed)...
> I use the following code in a process, and it works as intended.
>
> if pci_trdyn /= '0' then
> while pci_trdyn /= '0' loop
> wait for clock_period;
> end loop;
> wait for clock_period;
> else
> wait for clock_period;
> end if;
>
> I would like to replace this code with
>
> WaitSig(pci_trdyn ,'0',Clock_Period);
>
> where WaitSig is defined as
>
> procedure WaitSig(Sig,State : in std_logic; Clock_Period : in time) is
> begin
> if Sig /= State then
> while Sig /= State loop
> wait for clock_period;
> end loop;
> wait for clock_period;
> else
> wait for clock_period;
> end if;
> end procedure;
>
> This does not work. Why? Is it because signals are not updated dynamically
> while a procedure executes?
> Is there another mechanism I can use to simplify my code?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
procedure as argument in procedure AlexWare VHDL 2 10-23-2009 09:14 AM
'Procedure or function <stored procedure name> has too many arguments specified',,,ARGH! Mike P ASP .Net 0 06-19-2006 01:19 PM
Re: need help with a complicated stored procedure please iixv Microsoft Certification 0 07-30-2005 04:34 PM
Need help on Cisco Hyperswitch A100(LS100) password recovery procedure Lufan Chen Cisco 1 11-29-2003 04:29 AM
error msg help needed on stored procedure TJS ASP .Net 4 11-12-2003 11:15 PM



Advertisments