nickg/nvc — pull request #50 by hiyuh (2014-02-25 06:21:22+00:00)
Title: Fix for type conversion.

w/ proposed regression issueB,
```
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity issueB is
begin
end entity issueB;

architecture a of issueB is
type t is (is_unsigned, is_unsigned_dup, is_signed, is_signed_dup);
constant c : t := is_signed_dup;
procedure pAgtB (
iA : in std_logic_vector(7 downto 0);
iB : in std_logic_vector(7 downto 0);
oC : out boolean
) is
begin
case c is
when is_unsigned|
is_unsigned_dup =>
if (unsigned(iA) > unsigned(iB)) then
oC := true;
else
oC := false;
end if;
when is_signed|
is_signed_dup =>
if (signed(iA) > signed(iB)) then
oC := true;
else
oC := false;
end if;
end case;
end procedure pAgtB;
begin
process
variable vC : boolean := false;
begin
pAgtB(iA => X"7F", iB => X"FF", oC => vC);
assert (vC = true);
wait;
end process;
end architecture a;
```
then i got,
```
$ NVC_LIBPATH=./lib/std:./lib/ieee:./lib/nvc NVC_CYG_LIB=./src ./src/nvc.exe -a test/regress/issueB.vhd
** Error: cannot check T_TYPE_CONV
File test/regress/issueB.vhd, Line 21
if (unsigned(iA) > unsigned(iB)) then
^^^^^^^^^^^^
** Error: cannot check T_TYPE_CONV
File test/regress/issueB.vhd, Line 28
if (signed(iA) > signed(iB)) then
^^^^^^^^^^
```

w/ following commits, i got,
```
$ NVC_LIBPATH=./lib/std:./lib/ieee:./lib/nvc NVC_CYG_LIB=./src ./src/nvc.exe -a test/regress/issueB.vhd

$ NVC_LIBPATH=./lib/std:./lib/ieee:./lib/nvc NVC_CYG_LIB=./src ./src/nvc.exe -e issueB
/usr/bin/opt -O2 -o /home/hiyuh/git-repos/nvc/work/_WORK.ISSUEB.final.bc /home/hiyuh/git-repos/nvc/work/_WORK.ISSUEB.elab.bc

$ NVC_LIBPATH=./lib/std:./lib/ieee:./lib/nvc NVC_CYG_LIB=./src ./src/nvc.exe --dump -e issueB
[dump looks OK to me]

$ NVC_LIBPATH=./lib/std:./lib/ieee:./lib/nvc NVC_CYG_LIB=./src ./src/nvc.exe -r issueB
[no assertion failure]
```