M
M. Norton
Guest
Well this one was a new one on me. Granted this is a warning, but
thought it might be worth running down, as it seemed to be one of
those warnings I want to make certain disappear. From Modelsim:
** Warning: blah blah(183): Case choice must be a locally static
expression.
So, here's the structure I have. In a package I created an array of
records and defined them, like so:
type filt_record is record
name : string(1 to 18);
address : std_logic_vector(10 downto 0);
weight : integer;
a429_label : std_logic_vector(7 downto 0);
end record filt_record;
type filt_table is array (0 to NUM_CHANNELS-1) of filt record;
constant FILT_DATA : filt_table := (
0 => ("Display Brightness", "000--------", 1, "01000000"),
... yada yada ...
27 => ("Combiner +12V ", "111-----111", 16, "10110001"));
Okay, so far, so good. Also, so I could refer to the indicies by
name, I created a number of constants mapping name to integer, like
so:
constant DISPLAY_BRIGHTNESS : integer := 0;
....
constant COMB_P12V : integer := 27;
Seems fine. So onto the code that caused the warning. The package is
declared properly, and so forth earlier. The signal below
"label_value" is a signal and is a smaller slice of a larger input
std_logic_vector port. So it's well declared.
LABEL_CHECKING : process is
begin
loop
wait until some'event;
--
-- Perform some specific label checks
--
case label_value is
when FILT_DATA(COMB_BACKLIGHT).a429_label =>
-- Do some stuff
when others =>
null;
end case;
end loop;
end process LABEL_CHECKING;
The only thing I can think is that the compiler thinks
FILT_DATA(COMB_BACKLIGHT).a429_label is not locally static. However,
FILT_DATA is a constant array of records and COMB_BACKLIGHT is one of
those array index constants. It seems to me like everything in the
"when" statement should evaluate to something that cannot change.
So, is Modelsim throwing a warning about nothing, or is there
something I've missed?
Thanks for any help with this oddball warning.
Best regards,
Mark Norton
thought it might be worth running down, as it seemed to be one of
those warnings I want to make certain disappear. From Modelsim:
** Warning: blah blah(183): Case choice must be a locally static
expression.
So, here's the structure I have. In a package I created an array of
records and defined them, like so:
type filt_record is record
name : string(1 to 18);
address : std_logic_vector(10 downto 0);
weight : integer;
a429_label : std_logic_vector(7 downto 0);
end record filt_record;
type filt_table is array (0 to NUM_CHANNELS-1) of filt record;
constant FILT_DATA : filt_table := (
0 => ("Display Brightness", "000--------", 1, "01000000"),
... yada yada ...
27 => ("Combiner +12V ", "111-----111", 16, "10110001"));
Okay, so far, so good. Also, so I could refer to the indicies by
name, I created a number of constants mapping name to integer, like
so:
constant DISPLAY_BRIGHTNESS : integer := 0;
....
constant COMB_P12V : integer := 27;
Seems fine. So onto the code that caused the warning. The package is
declared properly, and so forth earlier. The signal below
"label_value" is a signal and is a smaller slice of a larger input
std_logic_vector port. So it's well declared.
LABEL_CHECKING : process is
begin
loop
wait until some'event;
--
-- Perform some specific label checks
--
case label_value is
when FILT_DATA(COMB_BACKLIGHT).a429_label =>
-- Do some stuff
when others =>
null;
end case;
end loop;
end process LABEL_CHECKING;
The only thing I can think is that the compiler thinks
FILT_DATA(COMB_BACKLIGHT).a429_label is not locally static. However,
FILT_DATA is a constant array of records and COMB_BACKLIGHT is one of
those array index constants. It seems to me like everything in the
"when" statement should evaluate to something that cannot change.
So, is Modelsim throwing a warning about nothing, or is there
something I've missed?
Thanks for any help with this oddball warning.
Best regards,
Mark Norton