AR# 7158

|

FPGA Express - VHDL Error: "Range 'U' to 'X' (or 'Z' to '-') not covered by choices. (VSS-838)"

描述

Keywords: 1.5, 1.5i, Foundation, 3.1, 3.2, Express, range, not, covered, VSS, 838, VSS-838, mux,
multiplex, multiplexer, VHDL

Urgency: Standard

General Description:
I am checking the syntax of a VHDL code block for inference of a multiplexer; when the
port is defined as:

MUX_CTRL: in STD_LOGIC;

and the code within the process statement is:

case MUX_CTRL is
when '0' =>
<<do_something>>;
when '1' =>
<<do_something_else>>;
end case;

FPGA Express gives the following error:

Error: Range 'U' to 'X' not covered by choices. (VSS-838) (FE-dm-hdlc-unknown)
Error: "Range 'Z' to '-' not covered by choices. (VSS-838) (FE-dm-hdlc-unknown)

解决方案

This occurs because not all possible values of STD_LOGIC were covered by the case statement.
There are values possible for STD_LOGIC other than simply "0" and "1" (e.g., "U", "X", and "Z")
that need to be covered. To do this, simply add the following to the end of the case statement:

when others => null;

Preferably, this will take the place of the last comparison in the case statement.

The following is the case statement code given in the HDL Editor Language Assistant:

case <expression> is
when <choices> =>
<statements>
when <choices> =>
<statements>
when others =>
<statements>
end case;
-- example:
--case SEL is
-- when 0 | 1 | 2 =>
-- Z <= B;
-- when 3 to 10 =>
-- Z <= C;
-- when others =>
-- null;
--end case;
AR# 7158
日期 08/11/2003
状态 Archive
Type 综合文章
People Also Viewed