Why can't I use anything but (0 and 1) when I specify the radix in a literal?

Viewed 62
y <= a when (s = b"--0") else '0' -- Erroneous.
y <= a when (s = "--0")  else '0' -- Okay.

I'm using Vivado and it gives me the error Error: '-' is not a valid character in b"--0" only if I type the radix in front of the literal. It does the same with Z, U, X, L, W, and H.

Note that this works fine when I use VHDL 2008 and I already use it but I wanted to know why is this the behaviour in VHDL.

My first thought is that b"000", for example, is treated as a BIT_VECTOR, but I tried the following:

architecture behav of ent is
    signal bv: BIT_VECTOR(2 DOWNTO 0) := b"000";
begin
    y <= a when (s = bv); -- Erroneous.
end behav;

But this did not work. Vivado gave me an error that there's no = operator defined for those two types. So I think that b"000" is not implicitly a BIT_VECTOR.

0 Answers
Related