W
Willem Oosthuizen
Guest
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?
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?