Package: fixed_generic_pkg
- File: fixed_generic_pkg.vhdl
Constants
Name | Type | Value | Description |
---|---|---|---|
CopyRightNotice | STRING | "Copyright 2008 by IEEE. All rights reserved." |
Types
Name | Type | Description |
---|---|---|
UNRESOLVED_ufixed | array (INTEGER range <>) of STD_ULOGIC | base Unsigned fixed point type, downto direction assumed |
UNRESOLVED_sfixed | array (INTEGER range <>) of STD_ULOGIC | base Signed fixed point type, downto direction assumed |
Functions
- divide ( l,
r : UNRESOLVED_ufixed;
constant round_style : fixed_round_style_type := fixed_round_style;
constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_ufixed
Description
This version of divide gives the user more control
ufixed(a downto b) / ufixed(c downto d) = ufixed(a-d downto b-c-1)
- divide ( l,
r : UNRESOLVED_sfixed;
constant round_style : fixed_round_style_type := fixed_round_style;
constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_sfixed
Description
This version of divide gives the user more control
sfixed(a downto b) / sfixed(c downto d) = sfixed(a-d+1 downto b-c)
- reciprocal ( arg : UNRESOLVED_ufixed;
-- fixed point input constant round_style : fixed_round_style_type := fixed_round_style;
constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_ufixed
Description
These functions return 1/X
1 / ufixed(a downto b) = ufixed(-b downto -a-1)
- reciprocal ( arg : UNRESOLVED_sfixed;
-- fixed point input constant round_style : fixed_round_style_type := fixed_round_style;
constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_sfixed
Description
1 / sfixed(a downto b) = sfixed(-b+1 downto -a)
- remainder ( l,
r : UNRESOLVED_ufixed;
constant round_style : fixed_round_style_type := fixed_round_style;
constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_ufixed
Description
REM function
ufixed (a downto b) rem ufixed (c downto d)
= ufixed (minimum(a,c) downto minimum(b,d))
- remainder ( l,
r : UNRESOLVED_sfixed;
constant round_style : fixed_round_style_type := fixed_round_style;
constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_sfixed
Description
sfixed (a downto b) rem sfixed (c downto d)
= sfixed (minimum(a,c) downto minimum(b,d))
- modulo ( l,
r : UNRESOLVED_ufixed;
constant round_style : fixed_round_style_type := fixed_round_style;
constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_ufixed
Description
mod function
ufixed (a downto b) mod ufixed (c downto d)
= ufixed (minimum(a,c) downto minimum(b, d))
- modulo ( l,
r : UNRESOLVED_sfixed;
constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style;
constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_sfixed
Description
sfixed (a downto b) mod sfixed (c downto d)
= sfixed (c downto minimum(b, d))
- add_carry ( L,
R : in UNRESOLVED_ufixed;
c_in : in STD_ULOGIC;
result : out UNRESOLVED_ufixed;
c_out : out STD_ULOGIC) return ()
Description
Procedure for those who need an "accumulator" function.
add_carry (ufixed(a downto b), ufixed (c downto d))
= ufixed (maximum(a,c) downto minimum(b,d))
- add_carry ( L,
R : in UNRESOLVED_sfixed;
c_in : in STD_ULOGIC;
result : out UNRESOLVED_sfixed;
c_out : out STD_ULOGIC) return ()
Description
add_carry (sfixed(a downto b), sfixed (c downto d))
= sfixed (maximum(a,c) downto minimum(b,d))
- scalb (y : UNRESOLVED_ufixed;
N : INTEGER) return UNRESOLVED_ufixed
Description
Scales the result by a power of 2. Width of input = width of output with
the binary point moved.
- scalb (y : UNRESOLVED_ufixed;
N : UNRESOLVED_SIGNED) return UNRESOLVED_ufixed
- scalb (y : UNRESOLVED_sfixed;
N : INTEGER) return UNRESOLVED_sfixed
- scalb (y : UNRESOLVED_sfixed;
N : UNRESOLVED_SIGNED) return UNRESOLVED_sfixed
- Is_Negative (arg : UNRESOLVED_sfixed) return BOOLEAN
- std_match (l,
r : UNRESOLVED_ufixed) return BOOLEAN
- std_match (l,
r : UNRESOLVED_sfixed) return BOOLEAN
- maximum (l,
r : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
Description
Overloads the default "maximum" and "minimum" function
- minimum (l,
r : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
- maximum (l,
r : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- minimum (l,
r : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- maximum (l : UNRESOLVED_ufixed;
r : NATURAL) return UNRESOLVED_ufixed
- minimum (l : UNRESOLVED_ufixed;
r : NATURAL) return UNRESOLVED_ufixed
- maximum (l : NATURAL;
r : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
- minimum (l : NATURAL;
r : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
- maximum (l : UNRESOLVED_ufixed;
r : REAL) return UNRESOLVED_ufixed
- maximum (l : REAL;
r : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
- minimum (l : UNRESOLVED_ufixed;
r : REAL) return UNRESOLVED_ufixed
- minimum (l : REAL;
r : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
- maximum (l : UNRESOLVED_sfixed;
r : INTEGER) return UNRESOLVED_sfixed
- maximum (l : INTEGER;
r : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- minimum (l : UNRESOLVED_sfixed;
r : INTEGER) return UNRESOLVED_sfixed
- minimum (l : INTEGER;
r : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- maximum (l : UNRESOLVED_sfixed;
r : REAL) return UNRESOLVED_sfixed
- maximum (l : REAL;
r : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- minimum (l : UNRESOLVED_sfixed;
r : REAL) return UNRESOLVED_sfixed
- minimum (l : REAL;
r : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- SHIFT_LEFT (ARG : UNRESOLVED_ufixed;
COUNT : NATURAL) return UNRESOLVED_ufixed
- SHIFT_RIGHT (ARG : UNRESOLVED_ufixed;
COUNT : NATURAL) return UNRESOLVED_ufixed
- SHIFT_LEFT (ARG : UNRESOLVED_sfixed;
COUNT : NATURAL) return UNRESOLVED_sfixed
- SHIFT_RIGHT (ARG : UNRESOLVED_sfixed;
COUNT : NATURAL) return UNRESOLVED_sfixed
- find_leftmost (arg : UNRESOLVED_ufixed;
y : STD_ULOGIC) return INTEGER
Description
returns arg'low-1 if not found
- find_leftmost (arg : UNRESOLVED_sfixed;
y : STD_ULOGIC) return INTEGER
- find_rightmost (arg : UNRESOLVED_ufixed;
y : STD_ULOGIC) return INTEGER
Description
returns arg'high+1 if not found
- find_rightmost (arg : UNRESOLVED_sfixed;
y : STD_ULOGIC) return INTEGER
- resize ( arg : UNRESOLVED_ufixed;
-- input constant left_index : INTEGER;
-- integer portion constant right_index : INTEGER;
-- size of fraction constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_ufixed
Description
RESIZE Functions
resizes the number (larger or smaller)
The returned result will be ufixed (left_index downto right_index)
If "round_style" is fixed_round, then the result will be rounded.
If the MSB of the remainder is a "1" AND the LSB of the unrounded result
is a '1' or the lower bits of the remainder include a '1' then the result
will be increased by the smallest representable number for that type.
"overflow_style" can be fixed_saturate or fixed_wrap.
In saturate mode, if the number overflows then the largest possible
representable number is returned. If wrap mode, then the upper bits
of the number are truncated.
- resize ( arg : UNRESOLVED_ufixed;
-- input size_res : UNRESOLVED_ufixed;
-- for size only constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_ufixed
Description
"size_res" functions create the size of the output from the indices
of the "size_res" input. The actual value of "size_res" is not used.
- resize ( arg : UNRESOLVED_sfixed;
-- input constant left_index : INTEGER;
-- integer portion constant right_index : INTEGER;
-- size of fraction constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_sfixed
Description
Note that in "wrap" mode the sign bit is not replicated. Thus the
resize of a negative number can have a positive result in wrap mode.
- resize ( arg : UNRESOLVED_sfixed;
-- input size_res : UNRESOLVED_sfixed;
-- for size only constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_sfixed
- to_ufixed ( arg : NATURAL;
-- integer constant left_index : INTEGER;
-- left index (high index) constant right_index : INTEGER := 0;
-- right index constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_ufixed
Description
Conversion Functions
integer (natural) to unsigned fixed point.
arguments are the upper and lower bounds of the number, thus
ufixed (7 downto -3) <= to_ufixed (int, 7, -3);
- to_ufixed ( arg : NATURAL;
-- integer size_res : UNRESOLVED_ufixed;
-- for size only constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_ufixed
- to_ufixed ( arg : REAL;
-- real constant left_index : INTEGER;
-- left index (high index) constant right_index : INTEGER;
-- right index constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style;
constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_ufixed
Description
real to unsigned fixed point
- to_ufixed ( arg : REAL;
-- real size_res : UNRESOLVED_ufixed;
-- for size only constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style;
constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_ufixed
- to_ufixed ( arg : UNRESOLVED_UNSIGNED;
-- unsigned constant left_index : INTEGER;
-- left index (high index) constant right_index : INTEGER := 0;
-- right index constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_ufixed
Description
unsigned to unsigned fixed point
- to_ufixed ( arg : UNRESOLVED_UNSIGNED;
-- unsigned size_res : UNRESOLVED_ufixed;
-- for size only constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_ufixed
- to_ufixed ( arg : UNRESOLVED_UNSIGNED) return UNRESOLVED_ufixed
Description
Performs a conversion. ufixed (arg'range) is returned
- to_unsigned ( arg : UNRESOLVED_ufixed;
-- fixed point input constant size : NATURAL;
-- length of output constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_UNSIGNED
Description
unsigned fixed point to unsigned
- to_unsigned ( arg : UNRESOLVED_ufixed;
-- fixed point input size_res : UNRESOLVED_UNSIGNED;
-- used for length of output constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_UNSIGNED
Description
unsigned fixed point to unsigned
- to_real ( arg : UNRESOLVED_ufixed) return REAL
Description
unsigned fixed point to real
- to_integer ( arg : UNRESOLVED_ufixed;
-- fixed point input constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return NATURAL
Description
unsigned fixed point to integer
- to_sfixed ( arg : INTEGER;
-- integer constant left_index : INTEGER;
-- left index (high index) constant right_index : INTEGER := 0;
-- right index constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_sfixed
Description
Integer to UNRESOLVED_sfixed
- to_sfixed ( arg : INTEGER;
-- integer size_res : UNRESOLVED_sfixed;
-- for size only constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_sfixed
- to_sfixed ( arg : REAL;
-- real constant left_index : INTEGER;
-- left index (high index) constant right_index : INTEGER;
-- right index constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style;
constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_sfixed
Description
Real to sfixed
- to_sfixed ( arg : REAL;
-- real size_res : UNRESOLVED_sfixed;
-- for size only constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style;
constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_sfixed
- to_sfixed ( arg : UNRESOLVED_SIGNED;
-- signed constant left_index : INTEGER;
-- left index (high index) constant right_index : INTEGER := 0;
-- right index constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_sfixed
Description
signed to sfixed
- to_sfixed ( arg : UNRESOLVED_SIGNED;
-- signed size_res : UNRESOLVED_sfixed;
-- for size only constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_sfixed
- to_sfixed ( arg : UNRESOLVED_SIGNED) return UNRESOLVED_sfixed
Description
signed to sfixed (output assumed to be size of signed input)
- to_sfixed ( arg : UNRESOLVED_ufixed) return UNRESOLVED_sfixed
Description
Conversion from ufixed to sfixed
- to_signed ( arg : UNRESOLVED_sfixed;
-- fixed point input constant size : NATURAL;
-- length of output constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_SIGNED
Description
signed fixed point to signed
- to_signed ( arg : UNRESOLVED_sfixed;
-- fixed point input size_res : UNRESOLVED_SIGNED;
-- used for length of output constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return UNRESOLVED_SIGNED
Description
signed fixed point to signed
- to_real ( arg : UNRESOLVED_sfixed) return REAL
Description
signed fixed point to real
- to_integer ( arg : UNRESOLVED_sfixed;
-- fixed point input constant overflow_style : fixed_overflow_style_type := fixed_overflow_style;
constant round_style : fixed_round_style_type := fixed_round_style) return INTEGER
Description
signed fixed point to integer
- ufixed_high (left_index,
right_index : INTEGER;
operation : CHARACTER := 'X';
left_index2,
right_index2 : INTEGER := 0) return INTEGER
Description
Because of the fairly complicated sizing rules in the fixed point
packages these functions are provided to compute the result ranges
Example:
signal uf1 : ufixed (3 downto -3);
signal uf2 : ufixed (4 downto -2);
signal uf1multuf2 : ufixed (ufixed_high (3, -3, '', 4, -2) downto
ufixed_low (3, -3, '', 4, -2));
uf1multuf2 <= uf1 * uf2;
Valid characters: '+', '-', '*', '/', 'r' or 'R' (rem), 'm' or 'M' (mod),
'1' (reciprocal), 'a' or 'A' (abs), 'n' or 'N' (unary -)
- ufixed_low (left_index,
right_index : INTEGER;
operation : CHARACTER := 'X';
left_index2,
right_index2 : INTEGER := 0) return INTEGER
- sfixed_high (left_index,
right_index : INTEGER;
operation : CHARACTER := 'X';
left_index2,
right_index2 : INTEGER := 0) return INTEGER
- sfixed_low (left_index,
right_index : INTEGER;
operation : CHARACTER := 'X';
left_index2,
right_index2 : INTEGER := 0) return INTEGER
- ufixed_high (size_res : UNRESOLVED_ufixed;
operation : CHARACTER := 'X';
size_res2 : UNRESOLVED_ufixed) return INTEGER
Description
Same as above, but using the "size_res" input only for their ranges:
signal uf1multuf2 : ufixed (ufixed_high (uf1, '', uf2) downto
ufixed_low (uf1, '', uf2));
uf1multuf2 <= uf1 * uf2;
- ufixed_low (size_res : UNRESOLVED_ufixed;
operation : CHARACTER := 'X';
size_res2 : UNRESOLVED_ufixed) return INTEGER
- sfixed_high (size_res : UNRESOLVED_sfixed;
operation : CHARACTER := 'X';
size_res2 : UNRESOLVED_sfixed) return INTEGER
- sfixed_low (size_res : UNRESOLVED_sfixed;
operation : CHARACTER := 'X';
size_res2 : UNRESOLVED_sfixed) return INTEGER
- saturate ( constant left_index : INTEGER;
constant right_index : INTEGER) return UNRESOLVED_ufixed
Description
purpose: returns a saturated number
- saturate ( constant left_index : INTEGER;
constant right_index : INTEGER) return UNRESOLVED_sfixed
Description
purpose: returns a saturated number
- saturate ( size_res : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
- saturate ( size_res : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- to_01 ( s : UNRESOLVED_ufixed;
-- fixed point input constant XMAP : STD_ULOGIC := '0') return UNRESOLVED_ufixed
Description
Translation Functions
maps meta-logical values
- to_01 ( s : UNRESOLVED_sfixed;
-- fixed point input constant XMAP : STD_ULOGIC := '0') return UNRESOLVED_sfixed
Description
maps meta-logical values
- Is_X (arg : UNRESOLVED_ufixed) return BOOLEAN
- Is_X (arg : UNRESOLVED_sfixed) return BOOLEAN
- to_X01 (arg : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
- to_X01 (arg : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- to_X01Z (arg : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
- to_X01Z (arg : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- to_UX01 (arg : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
- to_UX01 (arg : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- to_slv ( arg : UNRESOLVED_ufixed) return STD_LOGIC_VECTOR
Description
straight vector conversion routines, needed for synthesis.
These functions are here so that a std_logic_vector can be
converted to and from sfixed and ufixed. Note that you can
not convert these vectors because of their negative index.
- to_slv ( arg : UNRESOLVED_sfixed) return STD_LOGIC_VECTOR
- to_sulv ( arg : UNRESOLVED_ufixed) return STD_ULOGIC_VECTOR
- to_sulv ( arg : UNRESOLVED_sfixed) return STD_ULOGIC_VECTOR
- to_ufixed ( arg : STD_ULOGIC_VECTOR;
-- shifted vector constant left_index : INTEGER;
constant right_index : INTEGER) return UNRESOLVED_ufixed
- to_ufixed ( arg : STD_ULOGIC_VECTOR;
-- shifted vector size_res : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
- to_sfixed ( arg : STD_ULOGIC_VECTOR;
-- shifted vector constant left_index : INTEGER;
constant right_index : INTEGER) return UNRESOLVED_sfixed
- to_sfixed ( arg : STD_ULOGIC_VECTOR;
-- shifted vector size_res : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- to_UFix ( arg : STD_ULOGIC_VECTOR;
width : NATURAL;
-- width of vector fraction : NATURAL) return UNRESOLVED_ufixed
Description
As a concession to those who use a graphical DSP environment,
these functions take parameters in those tools format and create
fixed point numbers. These functions are designed to convert from
a std_logic_vector to the VHDL fixed point format using the conventions
of these packages. In a pure VHDL environment you should use the
"to_ufixed" and "to_sfixed" routines.
unsigned fixed point
- to_SFix ( arg : STD_ULOGIC_VECTOR;
width : NATURAL;
-- width of vector fraction : NATURAL) return UNRESOLVED_sfixed
Description
signed fixed point
- UFix_high (width,
fraction : NATURAL;
operation : CHARACTER := 'X';
width2,
fraction2 : NATURAL := 0) return INTEGER
Description
finding the bounds of a number. These functions can be used like this:
signal xxx : ufixed (7 downto -3);
-- Which is the same as "ufixed (UFix_high (11,3) downto UFix_low(11,3))"
signal yyy : ufixed (UFix_high (11, 3, "+", 11, 3)
downto UFix_low(11, 3, "+", 11, 3));
Where "11" is the width of xxx (xxx'length),
and 3 is the lower bound (abs (xxx'low))
In a pure VHDL environment use "ufixed_high" and "ufixed_low"
- UFix_low (width,
fraction : NATURAL;
operation : CHARACTER := 'X';
width2,
fraction2 : NATURAL := 0) return INTEGER
- SFix_high (width,
fraction : NATURAL;
operation : CHARACTER := 'X';
width2,
fraction2 : NATURAL := 0) return INTEGER
Description
Same as above but for signed fixed point. Note that the width
of a signed fixed point number ignores the sign bit, thus
width = sxxx'length-1
- SFix_low (width,
fraction : NATURAL;
operation : CHARACTER := 'X';
width2,
fraction2 : NATURAL := 0) return INTEGER
- WRITE ( L : inout LINE;
-- input line VALUE : in UNRESOLVED_ufixed;
-- fixed point input JUSTIFIED : in SIDE := right;
FIELD : in WIDTH := 0) return ()
Description
string and textio Functions
purpose: writes fixed point into a line
- WRITE ( L : inout LINE;
-- input line VALUE : in UNRESOLVED_sfixed;
-- fixed point input JUSTIFIED : in SIDE := right;
FIELD : in WIDTH := 0) return ()
Description
purpose: writes fixed point into a line
- READ (L : inout LINE;
VALUE : out UNRESOLVED_ufixed) return ()
- READ (L : inout LINE;
VALUE : out UNRESOLVED_ufixed;
GOOD : out BOOLEAN) return ()
- READ (L : inout LINE;
VALUE : out UNRESOLVED_sfixed) return ()
- READ (L : inout LINE;
VALUE : out UNRESOLVED_sfixed;
GOOD : out BOOLEAN) return ()
- OWRITE ( L : inout LINE;
-- input line VALUE : in UNRESOLVED_ufixed;
-- fixed point input JUSTIFIED : in SIDE := right;
FIELD : in WIDTH := 0) return ()
Description
octal read and write
- OWRITE ( L : inout LINE;
-- input line VALUE : in UNRESOLVED_sfixed;
-- fixed point input JUSTIFIED : in SIDE := right;
FIELD : in WIDTH := 0) return ()
- OREAD (L : inout LINE;
VALUE : out UNRESOLVED_ufixed) return ()
- OREAD (L : inout LINE;
VALUE : out UNRESOLVED_ufixed;
GOOD : out BOOLEAN) return ()
- OREAD (L : inout LINE;
VALUE : out UNRESOLVED_sfixed) return ()
- OREAD (L : inout LINE;
VALUE : out UNRESOLVED_sfixed;
GOOD : out BOOLEAN) return ()
- HWRITE ( L : inout LINE;
-- input line VALUE : in UNRESOLVED_ufixed;
-- fixed point input JUSTIFIED : in SIDE := right;
FIELD : in WIDTH := 0) return ()
Description
hex read and write
- HWRITE ( L : inout LINE;
-- input line VALUE : in UNRESOLVED_sfixed;
-- fixed point input JUSTIFIED : in SIDE := right;
FIELD : in WIDTH := 0) return ()
Description
purpose: writes fixed point into a line
- HREAD (L : inout LINE;
VALUE : out UNRESOLVED_ufixed) return ()
- HREAD (L : inout LINE;
VALUE : out UNRESOLVED_ufixed;
GOOD : out BOOLEAN) return ()
- HREAD (L : inout LINE;
VALUE : out UNRESOLVED_sfixed) return ()
- HREAD (L : inout LINE;
VALUE : out UNRESOLVED_sfixed;
GOOD : out BOOLEAN) return ()
- to_string (value : UNRESOLVED_ufixed) return STRING
Description
returns a string, useful for:
assert (x = y) report "error found " & to_string(x) severity error;
- to_ostring (value : UNRESOLVED_ufixed) return STRING
- to_hstring (value : UNRESOLVED_ufixed) return STRING
- to_string (value : UNRESOLVED_sfixed) return STRING
- to_ostring (value : UNRESOLVED_sfixed) return STRING
- to_hstring (value : UNRESOLVED_sfixed) return STRING
- from_string ( bstring : STRING;
-- binary string constant left_index : INTEGER;
constant right_index : INTEGER) return UNRESOLVED_ufixed
Description
From string functions allow you to convert a string into a fixed
point number. Example:
signal uf1 : ufixed (3 downto -3);
uf1 <= from_string ("0110.100", uf1'high, uf1'low); -- 6.5
The "." is optional in this syntax, however it exist and is
in the wrong location an error is produced. Overflow will
result in saturation.
- from_ostring ( ostring : STRING;
-- Octal string constant left_index : INTEGER;
constant right_index : INTEGER) return UNRESOLVED_ufixed
Description
Octal and hex conversions work as follows:
uf1 <= from_hstring ("6.8", 3, -3); -- 6.5 (bottom zeros dropped)
uf1 <= from_ostring ("06.4", 3, -3); -- 6.5 (top zeros dropped)
- from_hstring ( hstring : STRING;
-- hex string constant left_index : INTEGER;
constant right_index : INTEGER) return UNRESOLVED_ufixed
- from_string ( bstring : STRING;
-- binary string constant left_index : INTEGER;
constant right_index : INTEGER) return UNRESOLVED_sfixed
- from_ostring ( ostring : STRING;
-- Octal string constant left_index : INTEGER;
constant right_index : INTEGER) return UNRESOLVED_sfixed
- from_hstring ( hstring : STRING;
-- hex string constant left_index : INTEGER;
constant right_index : INTEGER) return UNRESOLVED_sfixed
- from_string ( bstring : STRING;
-- binary string size_res : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
Description
Same as above, "size_res" is used for it's range only.
- from_ostring ( ostring : STRING;
-- Octal string size_res : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
- from_hstring ( hstring : STRING;
-- hex string size_res : UNRESOLVED_ufixed) return UNRESOLVED_ufixed
- from_string ( bstring : STRING;
-- binary string size_res : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- from_ostring ( ostring : STRING;
-- Octal string size_res : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- from_hstring ( hstring : STRING;
-- hex string size_res : UNRESOLVED_sfixed) return UNRESOLVED_sfixed
- from_string ( bstring : STRING) return UNRESOLVED_ufixed
Description
Direct conversion functions. Example:
signal uf1 : ufixed (3 downto -3);
uf1 <= from_string ("0110.100"); -- 6.5
In this case the "." is not optional, and the size of
the output must match exactly.
- from_ostring ( ostring : STRING) return UNRESOLVED_ufixed
Description
Direct octal and hex conversion functions. In this case
the string lengths must match. Example:
signal sf1 := sfixed (5 downto -3);
sf1 <= from_ostring ("71.4") -- -6.5
- from_hstring ( hstring : STRING) return UNRESOLVED_ufixed
- from_string ( bstring : STRING) return UNRESOLVED_sfixed
- from_ostring ( ostring : STRING) return UNRESOLVED_sfixed
- from_hstring ( hstring : STRING) return UNRESOLVED_sfixed