diff options
author | Tristan Gingold | 2014-10-29 20:36:29 +0100 |
---|---|---|
committer | Tristan Gingold | 2014-10-29 20:36:29 +0100 |
commit | e5071f1a02f16a369c504944934042fbfb09e5dc (patch) | |
tree | 1b891a41c024a308274c380c8189e3213085a7e8 /libraries | |
parent | 236a876a8448b89061bb71869c36a68aea0199c3 (diff) | |
download | ghdl-e5071f1a02f16a369c504944934042fbfb09e5dc.tar.gz ghdl-e5071f1a02f16a369c504944934042fbfb09e5dc.tar.bz2 ghdl-e5071f1a02f16a369c504944934042fbfb09e5dc.zip |
Add support for package interface.
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/Makefile.inc | 6 | ||||
-rw-r--r-- | libraries/ieee2008/float_generic_pkg-body.vhdl | 10 |
2 files changed, 9 insertions, 7 deletions
diff --git a/libraries/Makefile.inc b/libraries/Makefile.inc index ab29cfb..8979f24 100644 --- a/libraries/Makefile.inc +++ b/libraries/Makefile.inc @@ -57,9 +57,9 @@ ieee2008/numeric_std.vhdl ieee2008/numeric_std-body.vhdl \ ieee2008/numeric_std_unsigned.vhdl ieee2008/numeric_std_unsigned-body.vhdl \ ieee2008/fixed_float_types.vhdl \ ieee2008/fixed_generic_pkg.vhdl ieee2008/fixed_generic_pkg-body.vhdl \ -ieee2008/fixed_pkg.vhdl -#ieee2008/float_generic_pkg.vhdl ieee2008/float_generic_pkg-body.vhdl \ -#ieee2008/float_pkg.vhdl +ieee2008/fixed_pkg.vhdl \ +ieee2008/float_generic_pkg.vhdl ieee2008/float_generic_pkg-body.vhdl \ +ieee2008/float_pkg.vhdl STD87_BSRCS := $(STD_SRCS:.vhdl=.v87) STD93_BSRCS := $(STD_SRCS:.vhdl=.v93) diff --git a/libraries/ieee2008/float_generic_pkg-body.vhdl b/libraries/ieee2008/float_generic_pkg-body.vhdl index 6354546..2100f4a 100644 --- a/libraries/ieee2008/float_generic_pkg-body.vhdl +++ b/libraries/ieee2008/float_generic_pkg-body.vhdl @@ -370,12 +370,13 @@ package body float_generic_pkg is arg : UNRESOLVED_float) -- fp vector return STD_ULOGIC_VECTOR is + subtype result_subtype is STD_ULOGIC_VECTOR (arg'length-1 downto 0); variable result : STD_ULOGIC_VECTOR (arg'length-1 downto 0); begin -- function to_std_ulogic_vector if arg'length < 1 then return NSLV; end if; - result := STD_ULOGIC_VECTOR (arg); + result := result_subtype (arg); return result; end function to_sulv; @@ -2739,7 +2740,7 @@ package body float_generic_pkg is -- to_float (unsigned) function to_float ( - arg : UNSIGNED; + arg : UNRESOLVED_UNSIGNED; constant exponent_width : NATURAL := float_exponent_width; -- length of FP output exponent constant fraction_width : NATURAL := float_fraction_width; -- length of FP output fraction constant round_style : round_type := float_round_style) -- rounding option @@ -2764,7 +2765,7 @@ package body float_generic_pkg is -- to_float (signed) function to_float ( - arg : SIGNED; + arg : UNRESOLVED_SIGNED; constant exponent_width : NATURAL := float_exponent_width; -- length of FP output exponent constant fraction_width : NATURAL := float_fraction_width; -- length of FP output fraction constant round_style : round_type := float_round_style) -- rounding option @@ -5073,7 +5074,8 @@ package body float_generic_pkg is variable c : CHARACTER; begin while L /= null and L.all'length /= 0 loop - if (L.all(1) = ' ' or L.all(1) = NBSP or L.all(1) = HT) then + c := l (l'left); + if (c = ' ' or c = NBSP or c = HT) then read (l, c, readOk); else exit; |