> John is right, that two instances of the package declare distinct types.
Well, it looks like that effectively kills that idea.
There would be no way to convert between the types of the same name.
We still have the question of what to do with these pesky little
constants:
NO_WARNING (boolean) in numeric_std, numeric_bit, numeric_unsigned
and numeric_bit_unsigned
GUARD (natural, number of guard bits), round (boolean), and saturate
(boolean) in FIXED_PKG
fp_round_style (state type), fp_denormal (boolean), fp_check_error
(boolean), fp_guard_bits (natural) in the floating point packages.
I use these constants in the resize and conversion routines in
the packages example:
function to_ufixed (
arg : natural; -- integer
constant integer_width : integer; -- size of integer portion
constant fraction_width : integer := 0; -- size of fraction
constant round_style : boolean := round; -- turn on rounding by default
constant overflow_style : boolean := saturate) -- saturate by default
return ufixed;
However in the actual function call, "/" say, I only get two inputs
to play with, so I leave these as constants, which could produce extra
logic.
In the fixed point package, these only become an issue in the
"/" routine. To get around it, I created a separate parameterized
"divide" function.
However, in the floating point package, you would have to call the
base function "divide" instead of "/" to get around this.
Can anybody think of a better solution?
-- David W. Bishop dbishop@vhdl.org All standard disclaimers apply.Received on Fri Aug 27 10:50:57 2004
This archive was generated by hypermail 2.1.8 : Fri Aug 27 2004 - 10:51:23 PDT