When I attempt to use a constant (- xxx) in a case statement, XST reports the following error:
"ERROR:HDLParsers:817 Choice -xxx is not a locally static expression."
This problem occurs for the following reasons:
- The select expression in a case statement is something other than a signal.
- The select expression consists of a certain function.
- The select expression is indexing into a constant array.
IEEE specifications require that the select expression in a case statement is defined by a signal, and that the signal is defined before the case statement starts.
type select_expressions is (s0, s1, s2);
signal Select : select_expression;
case Select is
when s0 => q <= "01";
when s1 => q <= "10";
when s2 => q <= "11";
when others => q <= "00";
NOTE: The way in which the "Select" signal is assigned is determined by your design.