how to avoid warning

O

Olaf Petzold

Guest
Hello,

for a benchmark I use these code:

architecture .... is

signal inp_period : time := 1 us;
signal inp_duty_cycle : integer := 90;

begin

stimulie : process is
variable low_period : time :=
((100-inp_duty_cycle)*inp_period)/100;
variable high_period : time :=
(inp_duty_cycle*inp_period)/100;
variable inv : std_logic := '0';
begin
input <= ('1' xor inv) after low_period;
wait on input;
input <= ('0' xor inv) after high_period;
wait on input;
end process;

...

inp_period and inp_duty_cyle are changed at different times in the
testbench. I've got the (modelsim) warning:

Initial value of "low_period" depends on value of signal "inp_duty_cycle".
Initial value of "low_period" depends on value of signal "inp_period".

which are correct. Well, is there a quiet way?

Thanks and regards,
Olaf
 
On Thu, 27 Oct 2005 20:35:21 +0200, Olaf Petzold <olaf@mdcc-fun.net>
wrote:

Hello,

for a benchmark I use these code:

architecture .... is

signal inp_period : time := 1 us;
signal inp_duty_cycle : integer := 90;

begin

stimulie : process is
variable low_period : time :=
((100-inp_duty_cycle)*inp_period)/100;
variable high_period : time :=
(inp_duty_cycle*inp_period)/100;
variable inv : std_logic := '0';
begin
input <= ('1' xor inv) after low_period;
wait on input;
input <= ('0' xor inv) after high_period;
wait on input;
end process;

...

inp_period and inp_duty_cyle are changed at different times in the
testbench. I've got the (modelsim) warning:

Initial value of "low_period" depends on value of signal "inp_duty_cycle".
Initial value of "low_period" depends on value of signal "inp_period".

which are correct. Well, is there a quiet way?

Thanks and regards,
Olaf

inp_period and inp_duty_cycle should be constant instead of signal
 
Perhaps you should not use initial values with signals, if you don't
want the warnings. Use a loop statement and initialize before the loop.

stimulie : process is
variable low_period;
variable high_period;
variable inv : std_logic := '0';
begin
low _period:=((100-inp_duty_cycle)*inp_period)/100;
high_period := (inp_duty_cycle*inp_period)/100;
loop
input <= ('1' xor inv) after low_period;
wait on input;
input <= ('0' xor inv) after high_period;
wait on input;
end loop;
end process;
 

Welcome to EDABoard.com

Sponsor

Back
Top