FIXED_FLOAT_TYPES package declaration

Rounding and overflow style enums shared by the fixed-point and floating-point packages.

Use clause
library IEEE;
use IEEE.FIXED_FLOAT_TYPES.all;
Source
ieee/fixed_float_types.vhdl in the IEEE 1076 OSR, tag 1076-2019
Apache License 2.0, © 2019 IEEE P1076 WG Authors
Length
61 lines
VHDL revisions
Added in 1076-2008; updated through 1076-2019

Overview

FIXED_FLOAT_TYPES is a small support package whose only job is to define the enum types that FIXED_GENERIC_PKG and FLOAT_GENERIC_PKG take as generic parameters: rounding mode and overflow handling for fixed-point arithmetic, and IEEE-754 style rounding direction for floating-point arithmetic.

Per §16.10 of IEEE Std 1076-2019, the package declaration is the formal interface of the package; this declaration is exact, with no body required.

What's defined here

Types
fixed_round_style_type (fixed_round / fixed_truncate), fixed_overflow_style_type (fixed_saturate / fixed_wrap), round_type (round_nearest, round_inf, round_neginf, round_zero; mirrors the C99 FE_TONEAREST / FE_UPWARD / FE_DOWNWARD / FE_TOWARDZERO macros)
Used by
FIXED_GENERIC_PKG, FLOAT_GENERIC_PKG, and the instantiations FIXED_PKG and FLOAT_PKG.

VHDL source listing

ieee/fixed_float_types.vhdl: declaration (61 lines) 0 groups
License: Apache License 2.0 Download
doc

File header Comment block (42 lines)

lines 1–42
-- -----------------------------------------------------------------
-- 
-- Copyright 2019 IEEE P1076 WG Authors
-- 
-- See the LICENSE file distributed with this work for copyright and
-- licensing information and the AUTHORS file.
-- 
-- This file to you under the Apache License, Version 2.0 (the "License").
-- You may obtain a copy of the License at
-- 
--     http://www.apache.org/licenses/LICENSE-2.0
-- 
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied.  See the License for the specific language governing
-- permissions and limitations under the License.
--
--   Title      :  Fixed Point and Floating Point types package
--
--   Library   :  This package shall be compiled into a library
--                symbolically named IEEE.
--
--   Developers:  Accellera VHDL-TC and IEEE P1076 Working Group
--
--   Purpose   :  Definitions for use in fixed point and floating point
--                arithmetic packages
--
--   Note      :  This package may be modified to include additional data
--             :  required by tools, but it must in no way change the
--             :  external interfaces or simulation behavior of the
--             :  description. It is permissible to add comments and/or
--             :  attributes to the package declarations, but not to change
--             :  or delete any original lines of the package declaration.
--             :  The package body may be changed only in accordance with
--             :  the terms of Clause 16 of this standard.
--             :
-- --------------------------------------------------------------------
-- $Revision: 1220 $
-- $Date: 2008-04-10 17:16:09 +0930 (Thu, 10 Apr 2008) $
-- --------------------------------------------------------------------
package fixed_float_types is

  -- Types used for generics of fixed_generic_pkg

  type fixed_round_style_type is (fixed_round, fixed_truncate);

  type fixed_overflow_style_type is (fixed_saturate, fixed_wrap);

  -- Type used for generics of float_generic_pkg

  -- These are the same as the C FE_TONEAREST, FE_UPWARD, FE_DOWNWARD,
  -- and FE_TOWARDZERO floating point rounding macros.

  type round_type is (round_nearest,    -- Default, nearest LSB '0'
                      round_inf,        -- Round toward positive infinity
                      round_neginf,     -- Round toward negative infinity
                      round_zero);      -- Round toward zero (truncate)

end package fixed_float_types;