R
Rick North
Guest
Hi all,
ModelSim PE VHDL 6.0c warning
# ** Warning: sel.vhd: Case choice must be a locally static expression.
I have a package where the Event_Definition are stored they are all
equal lenght and of the same type.
But I get this "locally static expression" warning, which I think I
should not have, since the EventCH
does not change unless the package file changes. The lenght and type is
thus constant during the simulation.
I pasted a code snippet below. My goal is to use this design in several
systems which have different events.
So why the warning and what to to about it? Better way to write the
code?
Cheers,
Rick N
entity SelEvent is
generic (
system : systems := Bob);
port ( clk : in std_logic;
reset : in std_logic;
MyEnable : in std_logic;
EventCH : in unsigned(Event_definition(System)(Bob)'high
downto Event_definition(System)(Bob)'low);
MyEvent : out std_logic
);
end entity SelEvent;
process(clk, reset)
begin
if reset = '1' then
MyEvent <= '0';
elsif clk'event and clk = '1' then
case EventCh is
-- no warnings
-- when "000001" => MyEvent <= Phillips_Event and MyEnable;
-- when "000010" => MyEvent <= Pauls_Event and MyEnable;
-- when "000100" => MyEvent <= Peters_Event and MyEnable;
-- when "001000" => MyEvent <= Rays_Event and MyEnable;
-- when "010000" => MyEvent <= Sahras_Event and MyEnable;
-- when "100000" => MyEvent <= Bobs_Event and MyEnable;
-- warnings
when Event_definition(System)(Phillip) => MyEvent <=
Phillips_Event and MyEnable;
when Event_definition(System)(Paul) => MyEvent <=
Pauls_Event and MyEnable;
when Event_definition(System)(Ray) => MyEvent <= Rays_Event
and MyEnable;
when Event_definition(System)(Peter) => MyEvent <=
Peters_Event and MyEnable;
when Event_definition(System)(Sahra) => MyEvent <=
Sahras_Event and MyEnable;
when Event_definition(System)(Bob) => MyEvent <= Bobs_Event
and MyEnable;
when others => null;
-- translate off
assert false report "Error Selection for
MyEvent" severity note;
-- translate on
end case;
end if;
end process;
ModelSim PE VHDL 6.0c warning
# ** Warning: sel.vhd: Case choice must be a locally static expression.
I have a package where the Event_Definition are stored they are all
equal lenght and of the same type.
But I get this "locally static expression" warning, which I think I
should not have, since the EventCH
does not change unless the package file changes. The lenght and type is
thus constant during the simulation.
I pasted a code snippet below. My goal is to use this design in several
systems which have different events.
So why the warning and what to to about it? Better way to write the
code?
Cheers,
Rick N
entity SelEvent is
generic (
system : systems := Bob);
port ( clk : in std_logic;
reset : in std_logic;
MyEnable : in std_logic;
EventCH : in unsigned(Event_definition(System)(Bob)'high
downto Event_definition(System)(Bob)'low);
MyEvent : out std_logic
);
end entity SelEvent;
process(clk, reset)
begin
if reset = '1' then
MyEvent <= '0';
elsif clk'event and clk = '1' then
case EventCh is
-- no warnings
-- when "000001" => MyEvent <= Phillips_Event and MyEnable;
-- when "000010" => MyEvent <= Pauls_Event and MyEnable;
-- when "000100" => MyEvent <= Peters_Event and MyEnable;
-- when "001000" => MyEvent <= Rays_Event and MyEnable;
-- when "010000" => MyEvent <= Sahras_Event and MyEnable;
-- when "100000" => MyEvent <= Bobs_Event and MyEnable;
-- warnings
when Event_definition(System)(Phillip) => MyEvent <=
Phillips_Event and MyEnable;
when Event_definition(System)(Paul) => MyEvent <=
Pauls_Event and MyEnable;
when Event_definition(System)(Ray) => MyEvent <= Rays_Event
and MyEnable;
when Event_definition(System)(Peter) => MyEvent <=
Peters_Event and MyEnable;
when Event_definition(System)(Sahra) => MyEvent <=
Sahras_Event and MyEnable;
when Event_definition(System)(Bob) => MyEvent <= Bobs_Event
and MyEnable;
when others => null;
-- translate off
assert false report "Error Selection for
MyEvent" severity note;
-- translate on
end case;
end if;
end process;