- initial version
git-svn-id: http://moon:8086/svn/vhdl/trunk@1073 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
@@ -0,0 +1,126 @@
|
||||
---------------------------------------------------------------
|
||||
--
|
||||
-- This source file may be used and distributed without restriction.
|
||||
-- No declarations or definitions shall be included in this package.
|
||||
-- This package cannot be sold or distributed for profit.
|
||||
--
|
||||
-- ****************************************************************
|
||||
-- * *
|
||||
-- * W A R N I N G *
|
||||
-- * *
|
||||
-- * This DRAFT version IS NOT endorsed or approved by IEEE *
|
||||
-- * *
|
||||
-- ****************************************************************
|
||||
--
|
||||
-- Title: PACKAGE MATH_COMPLEX
|
||||
--
|
||||
-- Purpose: VHDL declarations for mathematical package MATH_COMPLEX
|
||||
-- which contains common complex constants and basic complex
|
||||
-- functions and operations.
|
||||
--
|
||||
-- Author: IEEE VHDL Math Package Study Group
|
||||
--
|
||||
-- Notes:
|
||||
-- The package body uses package IEEE.MATH_REAL
|
||||
--
|
||||
-- The package body shall be considered the formal definition of
|
||||
-- the semantics of this package. Tool developers may choose to implement
|
||||
-- the package body in the most efficient manner available to them.
|
||||
--
|
||||
-- History:
|
||||
-- Version 0.1 (Strawman) Jose A. Torres 6/22/92
|
||||
-- Version 0.2 Jose A. Torres 1/15/93
|
||||
-- Version 0.3 Jose A. Torres 4/13/93
|
||||
-- Version 0.4 Jose A. Torres 4/19/93
|
||||
-- Version 0.5 Jose A. Torres 4/20/93
|
||||
-- Version 0.6 Jose A. Torres 4/23/93 Added unary minus
|
||||
-- and CONJ for polar
|
||||
-- Version 0.7 Jose A. Torres 5/28/93 Rev up for compatibility
|
||||
-- with package body.
|
||||
-------------------------------------------------------------
|
||||
Library IEEE;
|
||||
|
||||
Package MATH_COMPLEX is
|
||||
|
||||
|
||||
type COMPLEX is record RE, IM: real; end record;
|
||||
type COMPLEX_VECTOR is array (integer range <>) of COMPLEX;
|
||||
type COMPLEX_POLAR is record MAG: real; ARG: real; end record;
|
||||
|
||||
constant CBASE_1: complex := COMPLEX'(1.0, 0.0);
|
||||
constant CBASE_j: complex := COMPLEX'(0.0, 1.0);
|
||||
constant CZERO: complex := COMPLEX'(0.0, 0.0);
|
||||
|
||||
function CABS(Z: in complex ) return real;
|
||||
-- returns absolute value (magnitude) of Z
|
||||
|
||||
function CARG(Z: in complex ) return real;
|
||||
-- returns argument (angle) in radians of a complex number
|
||||
|
||||
function CMPLX(X: in real; Y: in real:= 0.0 ) return complex;
|
||||
-- returns complex number X + iY
|
||||
|
||||
function "-" (Z: in complex ) return complex;
|
||||
-- unary minus
|
||||
|
||||
function "-" (Z: in complex_polar ) return complex_polar;
|
||||
-- unary minus
|
||||
|
||||
function CONJ (Z: in complex) return complex;
|
||||
-- returns complex conjugate
|
||||
|
||||
function CONJ (Z: in complex_polar) return complex_polar;
|
||||
-- returns complex conjugate
|
||||
|
||||
function CSQRT(Z: in complex ) return complex_vector;
|
||||
-- returns square root of Z; 2 values
|
||||
|
||||
function CEXP(Z: in complex ) return complex;
|
||||
-- returns e**Z
|
||||
|
||||
function COMPLEX_TO_POLAR(Z: in complex ) return complex_polar;
|
||||
-- converts complex to complex_polar
|
||||
|
||||
function POLAR_TO_COMPLEX(Z: in complex_polar ) return complex;
|
||||
-- converts complex_polar to complex
|
||||
|
||||
|
||||
-- arithmetic operators
|
||||
|
||||
function "+" ( L: in complex; R: in complex ) return complex;
|
||||
function "+" ( L: in complex_polar; R: in complex_polar) return complex;
|
||||
function "+" ( L: in complex_polar; R: in complex ) return complex;
|
||||
function "+" ( L: in complex; R: in complex_polar) return complex;
|
||||
function "+" ( L: in real; R: in complex ) return complex;
|
||||
function "+" ( L: in complex; R: in real ) return complex;
|
||||
function "+" ( L: in real; R: in complex_polar) return complex;
|
||||
function "+" ( L: in complex_polar; R: in real) return complex;
|
||||
|
||||
function "-" ( L: in complex; R: in complex ) return complex;
|
||||
function "-" ( L: in complex_polar; R: in complex_polar) return complex;
|
||||
function "-" ( L: in complex_polar; R: in complex ) return complex;
|
||||
function "-" ( L: in complex; R: in complex_polar) return complex;
|
||||
function "-" ( L: in real; R: in complex ) return complex;
|
||||
function "-" ( L: in complex; R: in real ) return complex;
|
||||
function "-" ( L: in real; R: in complex_polar) return complex;
|
||||
function "-" ( L: in complex_polar; R: in real) return complex;
|
||||
|
||||
function "*" ( L: in complex; R: in complex ) return complex;
|
||||
function "*" ( L: in complex_polar; R: in complex_polar) return complex;
|
||||
function "*" ( L: in complex_polar; R: in complex ) return complex;
|
||||
function "*" ( L: in complex; R: in complex_polar) return complex;
|
||||
function "*" ( L: in real; R: in complex ) return complex;
|
||||
function "*" ( L: in complex; R: in real ) return complex;
|
||||
function "*" ( L: in real; R: in complex_polar) return complex;
|
||||
function "*" ( L: in complex_polar; R: in real) return complex;
|
||||
|
||||
|
||||
function "/" ( L: in complex; R: in complex ) return complex;
|
||||
function "/" ( L: in complex_polar; R: in complex_polar) return complex;
|
||||
function "/" ( L: in complex_polar; R: in complex ) return complex;
|
||||
function "/" ( L: in complex; R: in complex_polar) return complex;
|
||||
function "/" ( L: in real; R: in complex ) return complex;
|
||||
function "/" ( L: in complex; R: in real ) return complex;
|
||||
function "/" ( L: in real; R: in complex_polar) return complex;
|
||||
function "/" ( L: in complex_polar; R: in real) return complex;
|
||||
end MATH_COMPLEX;
|
||||
@@ -0,0 +1,211 @@
|
||||
------------------------------------------------------------------------
|
||||
--
|
||||
-- This source file may be used and distributed without restriction.
|
||||
-- No declarations or definitions shall be added to this package.
|
||||
-- This package cannot be sold or distributed for profit.
|
||||
--
|
||||
-- ****************************************************************
|
||||
-- * *
|
||||
-- * W A R N I N G *
|
||||
-- * *
|
||||
-- * This DRAFT version IS NOT endorsed or approved by IEEE *
|
||||
-- * *
|
||||
-- ****************************************************************
|
||||
--
|
||||
-- Title: PACKAGE MATH_REAL
|
||||
--
|
||||
-- Library: This package shall be compiled into a library
|
||||
-- symbolically named IEEE.
|
||||
--
|
||||
-- Purpose: VHDL declarations for mathematical package MATH_REAL
|
||||
-- which contains common real constants, common real
|
||||
-- functions, and real trascendental functions.
|
||||
--
|
||||
-- Author: IEEE VHDL Math Package Study Group
|
||||
--
|
||||
-- Notes:
|
||||
-- The package body shall be considered the formal definition of
|
||||
-- the semantics of this package. Tool developers may choose to implement
|
||||
-- the package body in the most efficient manner available to them.
|
||||
--
|
||||
-- History:
|
||||
-- Version 0.1 (Strawman) Jose A. Torres 6/22/92
|
||||
-- Version 0.2 Jose A. Torres 1/15/93
|
||||
-- Version 0.3 Jose A. Torres 4/13/93
|
||||
-- Version 0.4 Jose A. Torres 4/19/93
|
||||
-- Version 0.5 Jose A. Torres 4/20/93 Added RANDOM()
|
||||
-- Version 0.6 Jose A. Torres 4/23/93 Renamed RANDOM as
|
||||
-- UNIFORM. Modified
|
||||
-- rights banner.
|
||||
-- Version 0.7 Jose A. Torres 5/28/93 Rev up for compatibility
|
||||
-- with package body.
|
||||
-------------------------------------------------------------
|
||||
Library IEEE;
|
||||
|
||||
Package MATH_REAL is
|
||||
|
||||
--
|
||||
-- commonly used constants
|
||||
--
|
||||
constant MATH_E : real := 2.71828_18284_59045_23536;
|
||||
-- value of e
|
||||
constant MATH_1_E: real := 0.36787_94411_71442_32160;
|
||||
-- value of 1/e
|
||||
constant MATH_PI : real := 3.14159_26535_89793_23846;
|
||||
-- value of pi
|
||||
constant MATH_1_PI : real := 0.31830_98861_83790_67154;
|
||||
-- value of 1/pi
|
||||
constant MATH_LOG_OF_2: real := 0.69314_71805_59945_30942;
|
||||
-- natural log of 2
|
||||
constant MATH_LOG_OF_10: real := 2.30258_50929_94045_68402;
|
||||
-- natural log of10
|
||||
constant MATH_LOG2_OF_E: real := 1.44269_50408_88963_4074;
|
||||
-- log base 2 of e
|
||||
constant MATH_LOG10_OF_E: real := 0.43429_44819_03251_82765;
|
||||
-- log base 10 of e
|
||||
constant MATH_SQRT2: real := 1.41421_35623_73095_04880;
|
||||
-- sqrt of 2
|
||||
constant MATH_SQRT1_2: real := 0.70710_67811_86547_52440;
|
||||
-- sqrt of 1/2
|
||||
constant MATH_SQRT_PI: real := 1.77245_38509_05516_02730;
|
||||
-- sqrt of pi
|
||||
constant MATH_DEG_TO_RAD: real := 0.01745_32925_19943_29577;
|
||||
-- conversion factor from degree to radian
|
||||
constant MATH_RAD_TO_DEG: real := 57.29577_95130_82320_87685;
|
||||
-- conversion factor from radian to degree
|
||||
|
||||
--
|
||||
-- attribute for functions whose implementation is foreign (C native)
|
||||
--
|
||||
attribute FOREIGN : string; -- predefined attribute in VHDL-1992
|
||||
|
||||
--
|
||||
-- function declarations
|
||||
--
|
||||
function SIGN (X: real ) return real;
|
||||
-- returns 1.0 if X > 0.0; 0.0 if X == 0.0; -1.0 if X < 0.0
|
||||
|
||||
function CEIL (X : real ) return real;
|
||||
-- returns smallest integer value (as real) not less than X
|
||||
|
||||
function FLOOR (X : real ) return real;
|
||||
-- returns largest integer value (as real) not greater than X
|
||||
|
||||
function ROUND (X : real ) return real;
|
||||
-- returns integer FLOOR(X + 0.5) if X > 0;
|
||||
-- return integer CEIL(X - 0.5) if X < 0
|
||||
|
||||
function FMAX (X, Y : real ) return real;
|
||||
-- returns the algebraically larger of X and Y
|
||||
|
||||
function FMIN (X, Y : real ) return real;
|
||||
-- returns the algebraically smaller of X and Y
|
||||
|
||||
procedure UNIFORM (variable Seed1,Seed2:inout integer; variable X:out real);
|
||||
-- returns a pseudo-random number with uniform distribution in the
|
||||
-- interval (0.0, 1.0).
|
||||
-- Before the first call to UNIFORM, the seed values (Seed1, Seed2) must
|
||||
-- be initialized to values in the range [1, 2147483562] and
|
||||
-- [1, 2147483398] respectively. The seed values are modified after
|
||||
-- each call to UNIFORM.
|
||||
-- This random number generator is portable for 32-bit computers, and
|
||||
-- it has period ~2.30584*(10**18) for each set of seed values.
|
||||
--
|
||||
-- For VHDL-1992, the seeds will be global variables, functions to
|
||||
-- initialize their values (INIT_SEED) will be provided, and the UNIFORM
|
||||
-- procedure call will be modified accordingly.
|
||||
|
||||
function SRAND (seed: in integer ) return integer;
|
||||
--
|
||||
-- sets value of seed for sequence of
|
||||
-- pseudo-random numbers.
|
||||
-- It uses the foreign native C function srand().
|
||||
attribute FOREIGN of SRAND : function is "C_NATIVE";
|
||||
|
||||
function RAND return integer;
|
||||
--
|
||||
-- returns an integer pseudo-random number with uniform distribution.
|
||||
-- It uses the foreign native C function rand().
|
||||
-- Seed for the sequence is initialized with the
|
||||
-- SRAND() function and value of the seed is changed every
|
||||
-- time SRAND() is called, but it is not visible.
|
||||
-- The range of generated values is platform dependent.
|
||||
attribute FOREIGN of RAND : function is "C_NATIVE";
|
||||
|
||||
function GET_RAND_MAX return integer;
|
||||
--
|
||||
-- returns the upper bound of the range of the
|
||||
-- pseudo-random numbers generated by RAND().
|
||||
-- The support for this function is platform dependent, and
|
||||
-- it uses foreign native C functions or constants.
|
||||
-- It may not be available in some platforms.
|
||||
-- Note: the value of (RAND() / GET_RAND_MAX()) is a
|
||||
-- pseudo-random number distributed between 0 & 1.
|
||||
attribute FOREIGN of GET_RAND_MAX : function is "C_NATIVE";
|
||||
|
||||
function SQRT (X : real ) return real;
|
||||
-- returns square root of X; X >= 0
|
||||
|
||||
function CBRT (X : real ) return real;
|
||||
-- returns cube root of X
|
||||
|
||||
function "**" (X : integer; Y : real) return real;
|
||||
-- returns Y power of X ==> X**Y;
|
||||
-- error if X = 0 and Y <= 0.0
|
||||
-- error if X < 0 and Y does not have an integer value
|
||||
|
||||
function "**" (X : real; Y : real) return real;
|
||||
-- returns Y power of X ==> X**Y;
|
||||
-- error if X = 0.0 and Y <= 0.0
|
||||
-- error if X < 0.0 and Y does not have an integer value
|
||||
|
||||
function EXP (X : real ) return real;
|
||||
-- returns e**X; where e = MATH_E
|
||||
|
||||
function LOG (X : real ) return real;
|
||||
-- returns natural logarithm of X; X > 0
|
||||
|
||||
function LOG (BASE: positive; X : real) return real;
|
||||
-- returns logarithm base BASE of X; X > 0
|
||||
|
||||
function SIN (X : real ) return real;
|
||||
-- returns sin X; X in radians
|
||||
|
||||
function COS ( X : real ) return real;
|
||||
-- returns cos X; X in radians
|
||||
|
||||
function TAN (X : real ) return real;
|
||||
-- returns tan X; X in radians
|
||||
-- X /= ((2k+1) * PI/2), where k is an integer
|
||||
|
||||
function ASIN (X : real ) return real;
|
||||
-- returns -PI/2 < asin X < PI/2; | X | <= 1
|
||||
|
||||
function ACOS (X : real ) return real;
|
||||
-- returns 0 < acos X < PI; | X | <= 1
|
||||
|
||||
function ATAN (X : real) return real;
|
||||
-- returns -PI/2 < atan X < PI/2
|
||||
|
||||
function ATAN2 (X : real; Y : real) return real;
|
||||
-- returns atan (X/Y); -PI < atan2(X,Y) < PI; Y /= 0.0
|
||||
|
||||
function SINH (X : real) return real;
|
||||
-- hyperbolic sine; returns (e**X - e**(-X))/2
|
||||
|
||||
function COSH (X : real) return real;
|
||||
-- hyperbolic cosine; returns (e**X + e**(-X))/2
|
||||
|
||||
function TANH (X : real) return real;
|
||||
-- hyperbolic tangent; -- returns (e**X - e**(-X))/(e**X + e**(-X))
|
||||
|
||||
function ASINH (X : real) return real;
|
||||
-- returns ln( X + sqrt( X**2 + 1))
|
||||
|
||||
function ACOSH (X : real) return real;
|
||||
-- returns ln( X + sqrt( X**2 - 1)); X >= 1
|
||||
|
||||
function ATANH (X : real) return real;
|
||||
-- returns (ln( (1 + X)/(1 - X)))/2 ; | X | < 1
|
||||
|
||||
end MATH_REAL;
|
||||
@@ -0,0 +1,813 @@
|
||||
-- ----------------------------------------------------------------------------
|
||||
--
|
||||
-- Copyright 1995 by IEEE. All rights reserved.
|
||||
--
|
||||
--This source file is considered by the IEEE to be an essential part of the use
|
||||
-- of the standard 1076.3 and as such may be distributed without change, except
|
||||
--as permitted by the standard. This source file may not be sold or distributed
|
||||
-- for profit. This package may be modified to include additional data required
|
||||
-- by tools, but must in no way change the external interfaces or simulation
|
||||
-- behaviour 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 approved package declaration. The package body may be
|
||||
-- changed only in accordance with the terms of clauses 7.1 and 7.2 of the
|
||||
-- standard.
|
||||
--
|
||||
-- Title : Standard VHDL Synthesis Package (1076.3, NUMERIC_BIT)
|
||||
--
|
||||
-- Library : This package shall be compiled into a library symbolically
|
||||
-- : named IEEE.
|
||||
--
|
||||
-- Developers : IEEE DASC Synthesis Working Group, PAR 1076.3
|
||||
--
|
||||
-- Purpose : This package defines numeric types and arithmetic functions
|
||||
-- : for use with synthesis tools. Two numeric types are defined:
|
||||
-- : -- > UNSIGNED: represents an UNSIGNED number in vector form
|
||||
-- : -- > SIGNED: represents a SIGNED number in vector form
|
||||
-- : The base element type is type BIT.
|
||||
-- : The leftmost bit is treated as the most significant bit.
|
||||
-- : Signed vectors are represented in two's complement form.
|
||||
-- : This package contains overloaded arithmetic operators on
|
||||
-- : the SIGNED and UNSIGNED types. The package also contains
|
||||
-- : useful type conversions functions, clock detection
|
||||
-- : functions, and other utility functions.
|
||||
-- :
|
||||
-- : If any argument to a function is a null array, a null array is
|
||||
-- : returned (exceptions, if any, are noted individually).
|
||||
--
|
||||
-- Limitation :
|
||||
--
|
||||
-- Note : No declarations or definitions shall be included in,
|
||||
-- : or excluded from this package. The "package declaration"
|
||||
-- : defines the types, subtypes and declarations of
|
||||
-- : NUMERIC_BIT. The NUMERIC_BIT package body shall be
|
||||
-- : considered the formal definition of the semantics of
|
||||
-- : this package. Tool developers may choose to implement
|
||||
-- : the package body in the most efficient manner available
|
||||
-- : to them.
|
||||
-- :
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Version : 2.4
|
||||
-- Date : 12 April 1995
|
||||
-- ----------------------------------------------------------------------------
|
||||
|
||||
package NUMERIC_BIT is
|
||||
constant CopyRightNotice: STRING
|
||||
:= "Copyright 1995 IEEE. All rights reserved.";
|
||||
|
||||
--===========================================================================
|
||||
-- Numeric array type definitions
|
||||
--===========================================================================
|
||||
|
||||
type UNSIGNED is array (NATURAL range <> ) of BIT;
|
||||
type SIGNED is array (NATURAL range <> ) of BIT;
|
||||
|
||||
--===========================================================================
|
||||
-- Arithmetic Operators:
|
||||
--===========================================================================
|
||||
|
||||
-- Id: A.1
|
||||
function "abs" (ARG: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0).
|
||||
-- Result: Returns the absolute value of a SIGNED vector ARG.
|
||||
|
||||
-- Id: A.2
|
||||
function "-" (ARG: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0).
|
||||
-- Result: Returns the value of the unary minus operation on a
|
||||
-- SIGNED vector ARG.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: A.3
|
||||
function "+" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0).
|
||||
-- Result: Adds two UNSIGNED vectors that may be of different lengths.
|
||||
|
||||
-- Id: A.4
|
||||
function "+" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0).
|
||||
-- Result: Adds two SIGNED vectors that may be of different lengths.
|
||||
|
||||
-- Id: A.5
|
||||
function "+" (L: UNSIGNED; R: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0).
|
||||
-- Result: Adds an UNSIGNED vector, L, with a non-negative INTEGER, R.
|
||||
|
||||
-- Id: A.6
|
||||
function "+" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0).
|
||||
-- Result: Adds a non-negative INTEGER, L, with an UNSIGNED vector, R.
|
||||
|
||||
-- Id: A.7
|
||||
function "+" (L: INTEGER; R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0).
|
||||
-- Result: Adds an INTEGER, L(may be positive or negative), to a SIGNED
|
||||
-- vector, R.
|
||||
|
||||
-- Id: A.8
|
||||
function "+" (L: SIGNED; R: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0).
|
||||
-- Result: Adds a SIGNED vector, L, to an INTEGER, R.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: A.9
|
||||
function "-" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0).
|
||||
-- Result: Subtracts two UNSIGNED vectors that may be of different lengths.
|
||||
|
||||
-- Id: A.10
|
||||
function "-" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0).
|
||||
-- Result: Subtracts a SIGNED vector, R, from another SIGNED vector, L,
|
||||
-- that may possibly be of different lengths.
|
||||
|
||||
-- Id: A.11
|
||||
function "-" (L: UNSIGNED; R: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0).
|
||||
-- Result: Subtracts a non-negative INTEGER, R, from an UNSIGNED vector, L.
|
||||
|
||||
-- Id: A.12
|
||||
function "-" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0).
|
||||
-- Result: Subtracts an UNSIGNED vector, R, from a non-negative INTEGER, L.
|
||||
|
||||
-- Id: A.13
|
||||
function "-" (L: SIGNED; R: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0).
|
||||
-- Result: Subtracts an INTEGER, R, from a SIGNED vector, L.
|
||||
|
||||
-- Id: A.14
|
||||
function "-" (L: INTEGER; R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0).
|
||||
-- Result: Subtracts a SIGNED vector, R, from an INTEGER, L.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: A.15
|
||||
function "*" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED((L'LENGTH+R'LENGTH-1) downto 0).
|
||||
-- Result: Performs the multiplication operation on two UNSIGNED vectors
|
||||
-- that may possibly be of different lengths.
|
||||
|
||||
-- Id: A.16
|
||||
function "*" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED((L'LENGTH+R'LENGTH-1) downto 0)
|
||||
-- Result: Multiplies two SIGNED vectors that may possibly be of
|
||||
-- different lengths.
|
||||
|
||||
-- Id: A.17
|
||||
function "*" (L: UNSIGNED; R: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED((L'LENGTH+L'LENGTH-1) downto 0).
|
||||
-- Result: Multiplies an UNSIGNED vector, L, with a non-negative
|
||||
-- INTEGER, R. R is converted to an UNSIGNED vector of
|
||||
-- size L'LENGTH before multiplication.
|
||||
|
||||
-- Id: A.18
|
||||
function "*" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED((R'LENGTH+R'LENGTH-1) downto 0).
|
||||
-- Result: Multiplies an UNSIGNED vector, R, with a non-negative
|
||||
-- INTEGER, L. L is converted to an UNSIGNED vector of
|
||||
-- size R'LENGTH before multiplication.
|
||||
|
||||
-- Id: A.19
|
||||
function "*" (L: SIGNED; R: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED((L'LENGTH+L'LENGTH-1) downto 0)
|
||||
-- Result: Multiplies a SIGNED vector, L, with an INTEGER, R. R is
|
||||
-- converted to a SIGNED vector of size L'LENGTH before
|
||||
-- multiplication.
|
||||
|
||||
-- Id: A.20
|
||||
function "*" (L: INTEGER; R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED((R'LENGTH+R'LENGTH-1) downto 0)
|
||||
-- Result: Multiplies a SIGNED vector, R, with an INTEGER, L. L is
|
||||
-- converted to a SIGNED vector of size R'LENGTH before
|
||||
-- multiplication.
|
||||
|
||||
--===========================================================================
|
||||
--
|
||||
-- NOTE: If second argument is zero for "/" operator, a severity level
|
||||
-- of ERROR is issued.
|
||||
|
||||
-- Id: A.21
|
||||
function "/" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Divides an UNSIGNED vector, L, by another UNSIGNED vector, R.
|
||||
|
||||
-- Id: A.22
|
||||
function "/" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Divides an SIGNED vector, L, by another SIGNED vector, R.
|
||||
|
||||
-- Id: A.23
|
||||
function "/" (L: UNSIGNED; R: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Divides an UNSIGNED vector, L, by a non-negative INTEGER, R.
|
||||
-- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH.
|
||||
|
||||
-- Id: A.24
|
||||
function "/" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Divides a non-negative INTEGER, L, by an UNSIGNED vector, R.
|
||||
-- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH.
|
||||
|
||||
-- Id: A.25
|
||||
function "/" (L: SIGNED; R: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Divides a SIGNED vector, L, by an INTEGER, R.
|
||||
-- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH.
|
||||
|
||||
-- Id: A.26
|
||||
function "/" (L: INTEGER; R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Divides an INTEGER, L, by a SIGNED vector, R.
|
||||
-- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH.
|
||||
|
||||
--===========================================================================
|
||||
--
|
||||
-- NOTE: If second argument is zero for "rem" operator, a severity level
|
||||
-- of ERROR is issued.
|
||||
|
||||
-- Id: A.27
|
||||
function "rem" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L rem R" where L and R are UNSIGNED vectors.
|
||||
|
||||
-- Id: A.28
|
||||
function "rem" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L rem R" where L and R are SIGNED vectors.
|
||||
|
||||
-- Id: A.29
|
||||
function "rem" (L: UNSIGNED; R: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L rem R" where L is an UNSIGNED vector and R is a
|
||||
-- non-negative INTEGER.
|
||||
-- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH.
|
||||
|
||||
-- Id: A.30
|
||||
function "rem" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L rem R" where R is an UNSIGNED vector and L is a
|
||||
-- non-negative INTEGER.
|
||||
-- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH.
|
||||
|
||||
-- Id: A.31
|
||||
function "rem" (L: SIGNED; R: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L rem R" where L is SIGNED vector and R is an INTEGER.
|
||||
-- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH.
|
||||
|
||||
-- Id: A.32
|
||||
function "rem" (L: INTEGER; R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L rem R" where R is SIGNED vector and L is an INTEGER.
|
||||
-- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH.
|
||||
|
||||
--===========================================================================
|
||||
--
|
||||
-- NOTE: If second argument is zero for "mod" operator, a severity level
|
||||
-- of ERROR is issued.
|
||||
|
||||
-- Id: A.33
|
||||
function "mod" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L mod R" where L and R are UNSIGNED vectors.
|
||||
|
||||
-- Id: A.34
|
||||
function "mod" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L mod R" where L and R are SIGNED vectors.
|
||||
|
||||
-- Id: A.35
|
||||
function "mod" (L: UNSIGNED; R: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L mod R" where L is an UNSIGNED vector and R
|
||||
-- is a non-negative INTEGER.
|
||||
-- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH.
|
||||
|
||||
-- Id: A.36
|
||||
function "mod" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L mod R" where R is an UNSIGNED vector and L
|
||||
-- is a non-negative INTEGER.
|
||||
-- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH.
|
||||
|
||||
-- Id: A.37
|
||||
function "mod" (L: SIGNED; R: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L mod R" where L is a SIGNED vector and
|
||||
-- R is an INTEGER.
|
||||
-- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH.
|
||||
|
||||
-- Id: A.38
|
||||
function "mod" (L: INTEGER; R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L mod R" where L is an INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
-- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH.
|
||||
|
||||
--===========================================================================
|
||||
-- Comparison Operators
|
||||
--===========================================================================
|
||||
|
||||
-- Id: C.1
|
||||
function ">" (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L > R" where L and R are UNSIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.2
|
||||
function ">" (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L > R" where L and R are SIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.3
|
||||
function ">" (L: NATURAL; R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L > R" where L is a non-negative INTEGER and
|
||||
-- R is an UNSIGNED vector.
|
||||
|
||||
-- Id: C.4
|
||||
function ">" (L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L > R" where L is a INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
|
||||
-- Id: C.5
|
||||
function ">" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L > R" where L is an UNSIGNED vector and
|
||||
-- R is a non-negative INTEGER.
|
||||
|
||||
-- Id: C.6
|
||||
function ">" (L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L > R" where L is a SIGNED vector and
|
||||
-- R is a INTEGER.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: C.7
|
||||
function "<" (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L < R" where L and R are UNSIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.8
|
||||
function "<" (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L < R" where L and R are SIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.9
|
||||
function "<" (L: NATURAL; R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L < R" where L is a non-negative INTEGER and
|
||||
-- R is an UNSIGNED vector.
|
||||
|
||||
-- Id: C.10
|
||||
function "<" (L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L < R" where L is an INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
|
||||
-- Id: C.11
|
||||
function "<" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L < R" where L is an UNSIGNED vector and
|
||||
-- R is a non-negative INTEGER.
|
||||
|
||||
-- Id: C.12
|
||||
function "<" (L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L < R" where L is a SIGNED vector and
|
||||
-- R is an INTEGER.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: C.13
|
||||
function "<=" (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L <= R" where L and R are UNSIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.14
|
||||
function "<=" (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L <= R" where L and R are SIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.15
|
||||
function "<=" (L: NATURAL; R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L <= R" where L is a non-negative INTEGER and
|
||||
-- R is an UNSIGNED vector.
|
||||
|
||||
-- Id: C.16
|
||||
function "<=" (L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L <= R" where L is an INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
|
||||
-- Id: C.17
|
||||
function "<=" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L <= R" where L is an UNSIGNED vector and
|
||||
-- R is a non-negative INTEGER.
|
||||
|
||||
-- Id: C.18
|
||||
function "<=" (L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L <= R" where L is a SIGNED vector and
|
||||
-- R is an INTEGER.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: C.19
|
||||
function ">=" (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L >= R" where L and R are UNSIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.20
|
||||
function ">=" (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L >= R" where L and R are SIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.21
|
||||
function ">=" (L: NATURAL; R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L >= R" where L is a non-negative INTEGER and
|
||||
-- R is an UNSIGNED vector.
|
||||
|
||||
-- Id: C.22
|
||||
function ">=" (L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L >= R" where L is an INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
|
||||
-- Id: C.23
|
||||
function ">=" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L >= R" where L is an UNSIGNED vector and
|
||||
-- R is a non-negative INTEGER.
|
||||
|
||||
-- Id: C.24
|
||||
function ">=" (L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L >= R" where L is a SIGNED vector and
|
||||
-- R is an INTEGER.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: C.25
|
||||
function "=" (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L = R" where L and R are UNSIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.26
|
||||
function "=" (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L = R" where L and R are SIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.27
|
||||
function "=" (L: NATURAL; R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L = R" where L is a non-negative INTEGER and
|
||||
-- R is an UNSIGNED vector.
|
||||
|
||||
-- Id: C.28
|
||||
function "=" (L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L = R" where L is an INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
|
||||
-- Id: C.29
|
||||
function "=" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L = R" where L is an UNSIGNED vector and
|
||||
-- R is a non-negative INTEGER.
|
||||
|
||||
-- Id: C.30
|
||||
function "=" (L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L = R" where L is a SIGNED vector and
|
||||
-- R is an INTEGER.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: C.31
|
||||
function "/=" (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L /= R" where L and R are UNSIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.32
|
||||
function "/=" (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L /= R" where L and R are SIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.33
|
||||
function "/=" (L: NATURAL; R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L /= R" where L is a non-negative INTEGER and
|
||||
-- R is an UNSIGNED vector.
|
||||
|
||||
-- Id: C.34
|
||||
function "/=" (L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L /= R" where L is an INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
|
||||
-- Id: C.35
|
||||
function "/=" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L /= R" where L is an UNSIGNED vector and
|
||||
-- R is a non-negative INTEGER.
|
||||
|
||||
-- Id: C.36
|
||||
function "/=" (L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L /= R" where L is a SIGNED vector and
|
||||
-- R is an INTEGER.
|
||||
|
||||
--===========================================================================
|
||||
-- Shift and Rotate Functions
|
||||
--===========================================================================
|
||||
|
||||
-- Id: S.1
|
||||
function SHIFT_LEFT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a shift-left on an UNSIGNED vector COUNT times.
|
||||
-- The vacated positions are filled with Bit '0'.
|
||||
-- The COUNT leftmost bits are lost.
|
||||
|
||||
-- Id: S.2
|
||||
function SHIFT_RIGHT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a shift-right on an UNSIGNED vector COUNT times.
|
||||
-- The vacated positions are filled with Bit '0'.
|
||||
-- The COUNT rightmost bits are lost.
|
||||
|
||||
-- Id: S.3
|
||||
function SHIFT_LEFT (ARG: SIGNED; COUNT: NATURAL) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a shift-left on a SIGNED vector COUNT times.
|
||||
-- The vacated positions are filled with Bit '0'.
|
||||
-- The COUNT leftmost bits, except ARG'LEFT, are lost.
|
||||
|
||||
-- Id: S.4
|
||||
function SHIFT_RIGHT (ARG: SIGNED; COUNT: NATURAL) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a shift-right on a SIGNED vector COUNT times.
|
||||
-- The vacated positions are filled with the leftmost bit, ARG'LEFT.
|
||||
-- The COUNT rightmost bits are lost.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: S.5
|
||||
function ROTATE_LEFT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a rotate-left of an UNSIGNED vector COUNT times.
|
||||
|
||||
-- Id: S.6
|
||||
function ROTATE_RIGHT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a rotate-right of an UNSIGNED vector COUNT times.
|
||||
|
||||
-- Id: S.7
|
||||
function ROTATE_LEFT (ARG: SIGNED; COUNT: NATURAL) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a logical rotate-left of a SIGNED vector COUNT times.
|
||||
|
||||
-- Id: S.8
|
||||
function ROTATE_RIGHT (ARG: SIGNED; COUNT: NATURAL) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a logical rotate-right of a SIGNED vector COUNT times.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.9 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.9
|
||||
function "sll" (ARG: UNSIGNED; COUNT: INTEGER) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: SHIFT_LEFT(ARG, COUNT)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.10 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.10
|
||||
function "sll" (ARG: SIGNED; COUNT: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: SHIFT_LEFT(ARG, COUNT)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.11 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.11
|
||||
function "srl" (ARG: UNSIGNED; COUNT: INTEGER) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: SHIFT_RIGHT(ARG, COUNT)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.12 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.12
|
||||
function "srl" (ARG: SIGNED; COUNT: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: SIGNED(SHIFT_RIGHT(UNSIGNED(ARG), COUNT))
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.13 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.13
|
||||
function "rol" (ARG: UNSIGNED; COUNT: INTEGER) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: ROTATE_LEFT(ARG, COUNT)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.14 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.14
|
||||
function "rol" (ARG: SIGNED; COUNT: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: ROTATE_LEFT(ARG, COUNT)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.15 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.15
|
||||
function "ror" (ARG: UNSIGNED; COUNT: INTEGER) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: ROTATE_RIGHT(ARG, COUNT)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.16 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.16
|
||||
function "ror" (ARG: SIGNED; COUNT: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: ROTATE_RIGHT(ARG, COUNT)
|
||||
|
||||
--===========================================================================
|
||||
-- RESIZE Functions
|
||||
--===========================================================================
|
||||
|
||||
-- Id: R.1
|
||||
function RESIZE (ARG: SIGNED; NEW_SIZE: NATURAL) return SIGNED;
|
||||
-- Result subtype: SIGNED(NEW_SIZE-1 downto 0)
|
||||
-- Result: Resizes the SIGNED vector ARG to the specified size.
|
||||
-- To create a larger vector, the new [leftmost] bit positions
|
||||
-- are filled with the sign bit (ARG'LEFT). When truncating,
|
||||
-- the sign bit is retained along with the rightmost part.
|
||||
|
||||
-- Id: R.2
|
||||
function RESIZE (ARG: UNSIGNED; NEW_SIZE: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(NEW_SIZE-1 downto 0)
|
||||
-- Result: Resizes the UNSIGNED vector ARG to the specified size.
|
||||
-- To create a larger vector, the new [leftmost] bit positions
|
||||
-- are filled with '0'. When truncating, the leftmost bits
|
||||
-- are dropped.
|
||||
|
||||
--===========================================================================
|
||||
-- Conversion Functions
|
||||
--===========================================================================
|
||||
|
||||
-- Id: D.1
|
||||
function TO_INTEGER (ARG: UNSIGNED) return NATURAL;
|
||||
-- Result subtype: NATURAL. Value cannot be negative since parameter is an
|
||||
-- UNSIGNED vector.
|
||||
-- Result: Converts the UNSIGNED vector to an INTEGER.
|
||||
|
||||
-- Id: D.2
|
||||
function TO_INTEGER (ARG: SIGNED) return INTEGER;
|
||||
-- Result subtype: INTEGER
|
||||
-- Result: Converts a SIGNED vector to an INTEGER.
|
||||
|
||||
-- Id: D.3
|
||||
function TO_UNSIGNED (ARG, SIZE: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(SIZE-1 downto 0)
|
||||
-- Result: Converts a non-negative INTEGER to an UNSIGNED vector with
|
||||
-- the specified size.
|
||||
|
||||
-- Id: D.4
|
||||
function TO_SIGNED (ARG: INTEGER; SIZE: NATURAL) return SIGNED;
|
||||
-- Result subtype: SIGNED(SIZE-1 downto 0)
|
||||
-- Result: Converts an INTEGER to a SIGNED vector of the specified size.
|
||||
|
||||
--===========================================================================
|
||||
-- Logical Operators
|
||||
--===========================================================================
|
||||
|
||||
-- Id: L.1
|
||||
function "not" (L: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Termwise inversion
|
||||
|
||||
-- Id: L.2
|
||||
function "and" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector AND operation
|
||||
|
||||
-- Id: L.3
|
||||
function "or" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector OR operation
|
||||
|
||||
-- Id: L.4
|
||||
function "nand" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector NAND operation
|
||||
|
||||
-- Id: L.5
|
||||
function "nor" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector NOR operation
|
||||
|
||||
-- Id: L.6
|
||||
function "xor" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector XOR operation
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function L.7 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: L.7
|
||||
function "xnor" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector XNOR operation
|
||||
|
||||
-- Id: L.8
|
||||
function "not" (L: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Termwise inversion
|
||||
|
||||
-- Id: L.9
|
||||
function "and" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector AND operation
|
||||
|
||||
-- Id: L.10
|
||||
function "or" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector OR operation
|
||||
|
||||
-- Id: L.11
|
||||
function "nand" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector NAND operation
|
||||
|
||||
-- Id: L.12
|
||||
function "nor" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector NOR operation
|
||||
|
||||
-- Id: L.13
|
||||
function "xor" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector XOR operation
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function L.14 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: L.14
|
||||
function "xnor" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector XNOR operation
|
||||
|
||||
--===========================================================================
|
||||
-- Edge Detection Functions
|
||||
--===========================================================================
|
||||
|
||||
-- Id: E.1
|
||||
function RISING_EDGE (signal S: BIT) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Returns TRUE if an event is detected on signal S and the
|
||||
-- value changed from a '0' to a '1'.
|
||||
|
||||
-- Id: E.2
|
||||
function FALLING_EDGE (signal S: BIT) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Returns TRUE if an event is detected on signal S and the
|
||||
-- value changed from a '1' to a '0'.
|
||||
|
||||
end NUMERIC_BIT;
|
||||
@@ -0,0 +1,853 @@
|
||||
-- --------------------------------------------------------------------
|
||||
--
|
||||
-- Copyright 1995 by IEEE. All rights reserved.
|
||||
--
|
||||
--This source file is considered by the IEEE to be an essential part of the use
|
||||
-- of the standard 1076.3 and as such may be distributed without change, except
|
||||
--as permitted by the standard. This source file may not be sold or distributed
|
||||
-- for profit. This package may be modified to include additional data required
|
||||
-- by tools, but must in no way change the external interfaces or simulation
|
||||
-- behaviour 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 approved package declaration. The package body may be
|
||||
-- changed only in accordance with the terms of clauses 7.1 and 7.2 of the
|
||||
-- standard.
|
||||
--
|
||||
-- Title : Standard VHDL Synthesis Package (1076.3, NUMERIC_STD)
|
||||
--
|
||||
-- Library : This package shall be compiled into a library symbolically
|
||||
-- : named IEEE.
|
||||
--
|
||||
-- Developers : IEEE DASC Synthesis Working Group, PAR 1076.3
|
||||
--
|
||||
-- Purpose : This package defines numeric types and arithmetic functions
|
||||
-- : for use with synthesis tools. Two numeric types are defined:
|
||||
-- : -- > UNSIGNED: represents UNSIGNED number in vector form
|
||||
-- : -- > SIGNED: represents a SIGNED number in vector form
|
||||
-- : The base element type is type STD_LOGIC.
|
||||
-- : The leftmost bit is treated as the most significant bit.
|
||||
-- : Signed vectors are represented in two's complement form.
|
||||
-- : This package contains overloaded arithmetic operators on
|
||||
-- : the SIGNED and UNSIGNED types. The package also contains
|
||||
-- : useful type conversions functions.
|
||||
-- :
|
||||
-- : If any argument to a function is a null array, a null array is
|
||||
-- : returned (exceptions, if any, are noted individually).
|
||||
--
|
||||
-- Limitation :
|
||||
--
|
||||
-- Note : No declarations or definitions shall be included in,
|
||||
-- : or excluded from this package. The "package declaration"
|
||||
-- : defines the types, subtypes and declarations of
|
||||
-- : NUMERIC_STD. The NUMERIC_STD package body shall be
|
||||
-- : considered the formal definition of the semantics of
|
||||
-- : this package. Tool developers may choose to implement
|
||||
-- : the package body in the most efficient manner available
|
||||
-- : to them.
|
||||
--
|
||||
-- --------------------------------------------------------------------
|
||||
-- modification history :
|
||||
-- --------------------------------------------------------------------
|
||||
-- Version: 2.4
|
||||
-- Date : 12 April 1995
|
||||
-- ----------------------------------------------------------------------------
|
||||
library IEEE;
|
||||
use IEEE.STD_LOGIC_1164.all;
|
||||
|
||||
package NUMERIC_STD is
|
||||
constant CopyRightNotice: STRING
|
||||
:= "Copyright 1995 IEEE. All rights reserved.";
|
||||
|
||||
--===========================================================================
|
||||
-- Numeric array type definitions
|
||||
--===========================================================================
|
||||
|
||||
type UNSIGNED is array (NATURAL range <>) of STD_LOGIC;
|
||||
type SIGNED is array (NATURAL range <>) of STD_LOGIC;
|
||||
|
||||
--===========================================================================
|
||||
-- Arithmetic Operators:
|
||||
--===========================================================================
|
||||
|
||||
-- Id: A.1
|
||||
function "abs" (ARG: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0).
|
||||
-- Result: Returns the absolute value of a SIGNED vector ARG.
|
||||
|
||||
-- Id: A.2
|
||||
function "-" (ARG: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0).
|
||||
-- Result: Returns the value of the unary minus operation on a
|
||||
-- SIGNED vector ARG.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: A.3
|
||||
function "+" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0).
|
||||
-- Result: Adds two UNSIGNED vectors that may be of different lengths.
|
||||
|
||||
-- Id: A.4
|
||||
function "+" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0).
|
||||
-- Result: Adds two SIGNED vectors that may be of different lengths.
|
||||
|
||||
-- Id: A.5
|
||||
function "+" (L: UNSIGNED; R: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0).
|
||||
-- Result: Adds an UNSIGNED vector, L, with a non-negative INTEGER, R.
|
||||
|
||||
-- Id: A.6
|
||||
function "+" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0).
|
||||
-- Result: Adds a non-negative INTEGER, L, with an UNSIGNED vector, R.
|
||||
|
||||
-- Id: A.7
|
||||
function "+" (L: INTEGER; R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0).
|
||||
-- Result: Adds an INTEGER, L(may be positive or negative), to a SIGNED
|
||||
-- vector, R.
|
||||
|
||||
-- Id: A.8
|
||||
function "+" (L: SIGNED; R: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0).
|
||||
-- Result: Adds a SIGNED vector, L, to an INTEGER, R.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: A.9
|
||||
function "-" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0).
|
||||
-- Result: Subtracts two UNSIGNED vectors that may be of different lengths.
|
||||
|
||||
-- Id: A.10
|
||||
function "-" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0).
|
||||
-- Result: Subtracts a SIGNED vector, R, from another SIGNED vector, L,
|
||||
-- that may possibly be of different lengths.
|
||||
|
||||
-- Id: A.11
|
||||
function "-" (L: UNSIGNED;R: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0).
|
||||
-- Result: Subtracts a non-negative INTEGER, R, from an UNSIGNED vector, L.
|
||||
|
||||
-- Id: A.12
|
||||
function "-" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0).
|
||||
-- Result: Subtracts an UNSIGNED vector, R, from a non-negative INTEGER, L.
|
||||
|
||||
-- Id: A.13
|
||||
function "-" (L: SIGNED; R: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0).
|
||||
-- Result: Subtracts an INTEGER, R, from a SIGNED vector, L.
|
||||
|
||||
-- Id: A.14
|
||||
function "-" (L: INTEGER; R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0).
|
||||
-- Result: Subtracts a SIGNED vector, R, from an INTEGER, L.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: A.15
|
||||
function "*" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED((L'LENGTH+R'LENGTH-1) downto 0).
|
||||
-- Result: Performs the multiplication operation on two UNSIGNED vectors
|
||||
-- that may possibly be of different lengths.
|
||||
|
||||
-- Id: A.16
|
||||
function "*" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED((L'LENGTH+R'LENGTH-1) downto 0)
|
||||
-- Result: Multiplies two SIGNED vectors that may possibly be of
|
||||
-- different lengths.
|
||||
|
||||
-- Id: A.17
|
||||
function "*" (L: UNSIGNED; R: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED((L'LENGTH+L'LENGTH-1) downto 0).
|
||||
-- Result: Multiplies an UNSIGNED vector, L, with a non-negative
|
||||
-- INTEGER, R. R is converted to an UNSIGNED vector of
|
||||
-- SIZE L'LENGTH before multiplication.
|
||||
|
||||
-- Id: A.18
|
||||
function "*" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED((R'LENGTH+R'LENGTH-1) downto 0).
|
||||
-- Result: Multiplies an UNSIGNED vector, R, with a non-negative
|
||||
-- INTEGER, L. L is converted to an UNSIGNED vector of
|
||||
-- SIZE R'LENGTH before multiplication.
|
||||
|
||||
-- Id: A.19
|
||||
function "*" (L: SIGNED; R: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED((L'LENGTH+L'LENGTH-1) downto 0)
|
||||
-- Result: Multiplies a SIGNED vector, L, with an INTEGER, R. R is
|
||||
-- converted to a SIGNED vector of SIZE L'LENGTH before
|
||||
-- multiplication.
|
||||
|
||||
-- Id: A.20
|
||||
function "*" (L: INTEGER; R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED((R'LENGTH+R'LENGTH-1) downto 0)
|
||||
-- Result: Multiplies a SIGNED vector, R, with an INTEGER, L. L is
|
||||
-- converted to a SIGNED vector of SIZE R'LENGTH before
|
||||
-- multiplication.
|
||||
|
||||
--===========================================================================
|
||||
--
|
||||
-- NOTE: If second argument is zero for "/" operator, a severity level
|
||||
-- of ERROR is issued.
|
||||
|
||||
-- Id: A.21
|
||||
function "/" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Divides an UNSIGNED vector, L, by another UNSIGNED vector, R.
|
||||
|
||||
-- Id: A.22
|
||||
function "/" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Divides an SIGNED vector, L, by another SIGNED vector, R.
|
||||
|
||||
-- Id: A.23
|
||||
function "/" (L: UNSIGNED; R: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Divides an UNSIGNED vector, L, by a non-negative INTEGER, R.
|
||||
-- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH.
|
||||
|
||||
-- Id: A.24
|
||||
function "/" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Divides a non-negative INTEGER, L, by an UNSIGNED vector, R.
|
||||
-- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH.
|
||||
|
||||
-- Id: A.25
|
||||
function "/" (L: SIGNED; R: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Divides a SIGNED vector, L, by an INTEGER, R.
|
||||
-- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH.
|
||||
|
||||
-- Id: A.26
|
||||
function "/" (L: INTEGER; R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Divides an INTEGER, L, by a SIGNED vector, R.
|
||||
-- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH.
|
||||
|
||||
--===========================================================================
|
||||
--
|
||||
-- NOTE: If second argument is zero for "rem" operator, a severity level
|
||||
-- of ERROR is issued.
|
||||
|
||||
-- Id: A.27
|
||||
function "rem" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L rem R" where L and R are UNSIGNED vectors.
|
||||
|
||||
-- Id: A.28
|
||||
function "rem" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L rem R" where L and R are SIGNED vectors.
|
||||
|
||||
-- Id: A.29
|
||||
function "rem" (L: UNSIGNED; R: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L rem R" where L is an UNSIGNED vector and R is a
|
||||
-- non-negative INTEGER.
|
||||
-- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH.
|
||||
|
||||
-- Id: A.30
|
||||
function "rem" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L rem R" where R is an UNSIGNED vector and L is a
|
||||
-- non-negative INTEGER.
|
||||
-- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH.
|
||||
|
||||
-- Id: A.31
|
||||
function "rem" (L: SIGNED; R: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L rem R" where L is SIGNED vector and R is an INTEGER.
|
||||
-- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH.
|
||||
|
||||
-- Id: A.32
|
||||
function "rem" (L: INTEGER; R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L rem R" where R is SIGNED vector and L is an INTEGER.
|
||||
-- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH.
|
||||
|
||||
--===========================================================================
|
||||
--
|
||||
-- NOTE: If second argument is zero for "mod" operator, a severity level
|
||||
-- of ERROR is issued.
|
||||
|
||||
-- Id: A.33
|
||||
function "mod" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L mod R" where L and R are UNSIGNED vectors.
|
||||
|
||||
-- Id: A.34
|
||||
function "mod" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L mod R" where L and R are SIGNED vectors.
|
||||
|
||||
-- Id: A.35
|
||||
function "mod" (L: UNSIGNED; R: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L mod R" where L is an UNSIGNED vector and R
|
||||
-- is a non-negative INTEGER.
|
||||
-- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH.
|
||||
|
||||
-- Id: A.36
|
||||
function "mod" (L: NATURAL; R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L mod R" where R is an UNSIGNED vector and L
|
||||
-- is a non-negative INTEGER.
|
||||
-- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH.
|
||||
|
||||
-- Id: A.37
|
||||
function "mod" (L: SIGNED; R: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L mod R" where L is a SIGNED vector and
|
||||
-- R is an INTEGER.
|
||||
-- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH.
|
||||
|
||||
-- Id: A.38
|
||||
function "mod" (L: INTEGER; R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(R'LENGTH-1 downto 0)
|
||||
-- Result: Computes "L mod R" where L is an INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
-- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH.
|
||||
|
||||
--===========================================================================
|
||||
-- Comparison Operators
|
||||
--===========================================================================
|
||||
|
||||
-- Id: C.1
|
||||
function ">" (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L > R" where L and R are UNSIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.2
|
||||
function ">" (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L > R" where L and R are SIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.3
|
||||
function ">" (L: NATURAL; R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L > R" where L is a non-negative INTEGER and
|
||||
-- R is an UNSIGNED vector.
|
||||
|
||||
-- Id: C.4
|
||||
function ">" (L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L > R" where L is a INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
|
||||
-- Id: C.5
|
||||
function ">" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L > R" where L is an UNSIGNED vector and
|
||||
-- R is a non-negative INTEGER.
|
||||
|
||||
-- Id: C.6
|
||||
function ">" (L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L > R" where L is a SIGNED vector and
|
||||
-- R is a INTEGER.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: C.7
|
||||
function "<" (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L < R" where L and R are UNSIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.8
|
||||
function "<" (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L < R" where L and R are SIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.9
|
||||
function "<" (L: NATURAL; R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L < R" where L is a non-negative INTEGER and
|
||||
-- R is an UNSIGNED vector.
|
||||
|
||||
-- Id: C.10
|
||||
function "<" (L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L < R" where L is an INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
|
||||
-- Id: C.11
|
||||
function "<" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L < R" where L is an UNSIGNED vector and
|
||||
-- R is a non-negative INTEGER.
|
||||
|
||||
-- Id: C.12
|
||||
function "<" (L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L < R" where L is a SIGNED vector and
|
||||
-- R is an INTEGER.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: C.13
|
||||
function "<=" (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L <= R" where L and R are UNSIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.14
|
||||
function "<=" (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L <= R" where L and R are SIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.15
|
||||
function "<=" (L: NATURAL; R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L <= R" where L is a non-negative INTEGER and
|
||||
-- R is an UNSIGNED vector.
|
||||
|
||||
-- Id: C.16
|
||||
function "<=" (L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L <= R" where L is an INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
|
||||
-- Id: C.17
|
||||
function "<=" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L <= R" where L is an UNSIGNED vector and
|
||||
-- R is a non-negative INTEGER.
|
||||
|
||||
-- Id: C.18
|
||||
function "<=" (L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L <= R" where L is a SIGNED vector and
|
||||
-- R is an INTEGER.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: C.19
|
||||
function ">=" (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L >= R" where L and R are UNSIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.20
|
||||
function ">=" (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L >= R" where L and R are SIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.21
|
||||
function ">=" (L: NATURAL; R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L >= R" where L is a non-negative INTEGER and
|
||||
-- R is an UNSIGNED vector.
|
||||
|
||||
-- Id: C.22
|
||||
function ">=" (L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L >= R" where L is an INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
|
||||
-- Id: C.23
|
||||
function ">=" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L >= R" where L is an UNSIGNED vector and
|
||||
-- R is a non-negative INTEGER.
|
||||
|
||||
-- Id: C.24
|
||||
function ">=" (L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L >= R" where L is a SIGNED vector and
|
||||
-- R is an INTEGER.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: C.25
|
||||
function "=" (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L = R" where L and R are UNSIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.26
|
||||
function "=" (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L = R" where L and R are SIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.27
|
||||
function "=" (L: NATURAL; R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L = R" where L is a non-negative INTEGER and
|
||||
-- R is an UNSIGNED vector.
|
||||
|
||||
-- Id: C.28
|
||||
function "=" (L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L = R" where L is an INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
|
||||
-- Id: C.29
|
||||
function "=" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L = R" where L is an UNSIGNED vector and
|
||||
-- R is a non-negative INTEGER.
|
||||
|
||||
-- Id: C.30
|
||||
function "=" (L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L = R" where L is a SIGNED vector and
|
||||
-- R is an INTEGER.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: C.31
|
||||
function "/=" (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L /= R" where L and R are UNSIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.32
|
||||
function "/=" (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L /= R" where L and R are SIGNED vectors possibly
|
||||
-- of different lengths.
|
||||
|
||||
-- Id: C.33
|
||||
function "/=" (L: NATURAL; R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L /= R" where L is a non-negative INTEGER and
|
||||
-- R is an UNSIGNED vector.
|
||||
|
||||
-- Id: C.34
|
||||
function "/=" (L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L /= R" where L is an INTEGER and
|
||||
-- R is a SIGNED vector.
|
||||
|
||||
-- Id: C.35
|
||||
function "/=" (L: UNSIGNED; R: NATURAL) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L /= R" where L is an UNSIGNED vector and
|
||||
-- R is a non-negative INTEGER.
|
||||
|
||||
-- Id: C.36
|
||||
function "/=" (L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: Computes "L /= R" where L is a SIGNED vector and
|
||||
-- R is an INTEGER.
|
||||
|
||||
--===========================================================================
|
||||
-- Shift and Rotate Functions
|
||||
--===========================================================================
|
||||
|
||||
-- Id: S.1
|
||||
function SHIFT_LEFT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a shift-left on an UNSIGNED vector COUNT times.
|
||||
-- The vacated positions are filled with '0'.
|
||||
-- The COUNT leftmost elements are lost.
|
||||
|
||||
-- Id: S.2
|
||||
function SHIFT_RIGHT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a shift-right on an UNSIGNED vector COUNT times.
|
||||
-- The vacated positions are filled with '0'.
|
||||
-- The COUNT rightmost elements are lost.
|
||||
|
||||
-- Id: S.3
|
||||
function SHIFT_LEFT (ARG: SIGNED; COUNT: NATURAL) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a shift-left on a SIGNED vector COUNT times.
|
||||
-- The vacated positions are filled with '0'.
|
||||
-- The COUNT leftmost elements are lost.
|
||||
|
||||
-- Id: S.4
|
||||
function SHIFT_RIGHT (ARG: SIGNED; COUNT: NATURAL) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a shift-right on a SIGNED vector COUNT times.
|
||||
-- The vacated positions are filled with the leftmost
|
||||
-- element, ARG'LEFT. The COUNT rightmost elements are lost.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-- Id: S.5
|
||||
function ROTATE_LEFT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a rotate-left of an UNSIGNED vector COUNT times.
|
||||
|
||||
-- Id: S.6
|
||||
function ROTATE_RIGHT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a rotate-right of an UNSIGNED vector COUNT times.
|
||||
|
||||
-- Id: S.7
|
||||
function ROTATE_LEFT (ARG: SIGNED; COUNT: NATURAL) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a logical rotate-left of a SIGNED
|
||||
-- vector COUNT times.
|
||||
|
||||
-- Id: S.8
|
||||
function ROTATE_RIGHT (ARG: SIGNED; COUNT: NATURAL) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: Performs a logical rotate-right of a SIGNED
|
||||
-- vector COUNT times.
|
||||
|
||||
--===========================================================================
|
||||
|
||||
--===========================================================================
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.9 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.9
|
||||
function "sll" (ARG: UNSIGNED; COUNT: INTEGER) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: SHIFT_LEFT(ARG, COUNT)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.10 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.10
|
||||
function "sll" (ARG: SIGNED; COUNT: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: SHIFT_LEFT(ARG, COUNT)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.11 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.11
|
||||
function "srl" (ARG: UNSIGNED; COUNT: INTEGER) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: SHIFT_RIGHT(ARG, COUNT)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.12 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.12
|
||||
function "srl" (ARG: SIGNED; COUNT: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: SIGNED(SHIFT_RIGHT(UNSIGNED(ARG), COUNT))
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.13 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.13
|
||||
function "rol" (ARG: UNSIGNED; COUNT: INTEGER) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: ROTATE_LEFT(ARG, COUNT)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.14 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.14
|
||||
function "rol" (ARG: SIGNED; COUNT: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: ROTATE_LEFT(ARG, COUNT)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.15 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.15
|
||||
function "ror" (ARG: UNSIGNED; COUNT: INTEGER) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: ROTATE_RIGHT(ARG, COUNT)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Note : Function S.16 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-----------------------------------------------------------------------------
|
||||
-- Id: S.16
|
||||
function "ror" (ARG: SIGNED; COUNT: INTEGER) return SIGNED;
|
||||
-- Result subtype: SIGNED(ARG'LENGTH-1 downto 0)
|
||||
-- Result: ROTATE_RIGHT(ARG, COUNT)
|
||||
|
||||
--===========================================================================
|
||||
-- RESIZE Functions
|
||||
--===========================================================================
|
||||
|
||||
-- Id: R.1
|
||||
function RESIZE (ARG: SIGNED; NEW_SIZE: NATURAL) return SIGNED;
|
||||
-- Result subtype: SIGNED(NEW_SIZE-1 downto 0)
|
||||
-- Result: Resizes the SIGNED vector ARG to the specified size.
|
||||
-- To create a larger vector, the new [leftmost] bit positions
|
||||
-- are filled with the sign bit (ARG'LEFT). When truncating,
|
||||
-- the sign bit is retained along with the rightmost part.
|
||||
|
||||
-- Id: R.2
|
||||
function RESIZE (ARG: UNSIGNED; NEW_SIZE: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(NEW_SIZE-1 downto 0)
|
||||
-- Result: Resizes the SIGNED vector ARG to the specified size.
|
||||
-- To create a larger vector, the new [leftmost] bit positions
|
||||
-- are filled with '0'. When truncating, the leftmost bits
|
||||
-- are dropped.
|
||||
|
||||
--===========================================================================
|
||||
-- Conversion Functions
|
||||
--===========================================================================
|
||||
|
||||
-- Id: D.1
|
||||
function TO_INTEGER (ARG: UNSIGNED) return NATURAL;
|
||||
-- Result subtype: NATURAL. Value cannot be negative since parameter is an
|
||||
-- UNSIGNED vector.
|
||||
-- Result: Converts the UNSIGNED vector to an INTEGER.
|
||||
|
||||
-- Id: D.2
|
||||
function TO_INTEGER (ARG: SIGNED) return INTEGER;
|
||||
-- Result subtype: INTEGER
|
||||
-- Result: Converts a SIGNED vector to an INTEGER.
|
||||
|
||||
-- Id: D.3
|
||||
function TO_UNSIGNED (ARG, SIZE: NATURAL) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(SIZE-1 downto 0)
|
||||
-- Result: Converts a non-negative INTEGER to an UNSIGNED vector with
|
||||
-- the specified SIZE.
|
||||
|
||||
-- Id: D.4
|
||||
function TO_SIGNED (ARG: INTEGER; SIZE: NATURAL) return SIGNED;
|
||||
-- Result subtype: SIGNED(SIZE-1 downto 0)
|
||||
-- Result: Converts an INTEGER to a SIGNED vector of the specified SIZE.
|
||||
|
||||
--===========================================================================
|
||||
-- Logical Operators
|
||||
--===========================================================================
|
||||
|
||||
-- Id: L.1
|
||||
function "not" (L: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Termwise inversion
|
||||
|
||||
-- Id: L.2
|
||||
function "and" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector AND operation
|
||||
|
||||
-- Id: L.3
|
||||
function "or" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector OR operation
|
||||
|
||||
-- Id: L.4
|
||||
function "nand" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector NAND operation
|
||||
|
||||
-- Id: L.5
|
||||
function "nor" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector NOR operation
|
||||
|
||||
-- Id: L.6
|
||||
function "xor" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector XOR operation
|
||||
|
||||
-- --------------------------------------------------------------------------
|
||||
-- Note : Function L.7 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-- --------------------------------------------------------------------------
|
||||
-- Id: L.7
|
||||
function "xnor" (L, R: UNSIGNED) return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector XNOR operation
|
||||
|
||||
-- Id: L.8
|
||||
function "not" (L: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Termwise inversion
|
||||
|
||||
-- Id: L.9
|
||||
function "and" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector AND operation
|
||||
|
||||
-- Id: L.10
|
||||
function "or" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector OR operation
|
||||
|
||||
-- Id: L.11
|
||||
function "nand" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector NAND operation
|
||||
|
||||
-- Id: L.12
|
||||
function "nor" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector NOR operation
|
||||
|
||||
-- Id: L.13
|
||||
function "xor" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector XOR operation
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Note : Function L.14 is not compatible with VHDL 1076-1987. Comment
|
||||
-- out the function (declaration and body) for VHDL 1076-1987 compatibility.
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- Id: L.14
|
||||
function "xnor" (L, R: SIGNED) return SIGNED;
|
||||
-- Result subtype: SIGNED(L'LENGTH-1 downto 0)
|
||||
-- Result: Vector XNOR operation
|
||||
|
||||
--===========================================================================
|
||||
-- Match Functions
|
||||
--===========================================================================
|
||||
|
||||
-- Id: M.1
|
||||
function STD_MATCH (L, R: STD_ULOGIC) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: terms compared per STD_LOGIC_1164 intent
|
||||
|
||||
-- Id: M.2
|
||||
function STD_MATCH (L, R: UNSIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: terms compared per STD_LOGIC_1164 intent
|
||||
|
||||
-- Id: M.3
|
||||
function STD_MATCH (L, R: SIGNED) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: terms compared per STD_LOGIC_1164 intent
|
||||
|
||||
-- Id: M.4
|
||||
function STD_MATCH (L, R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: terms compared per STD_LOGIC_1164 intent
|
||||
|
||||
-- Id: M.5
|
||||
function STD_MATCH (L, R: STD_ULOGIC_VECTOR) return BOOLEAN;
|
||||
-- Result subtype: BOOLEAN
|
||||
-- Result: terms compared per STD_LOGIC_1164 intent
|
||||
|
||||
--===========================================================================
|
||||
-- Translation Functions
|
||||
--===========================================================================
|
||||
|
||||
-- Id: T.1
|
||||
function TO_01 (S: UNSIGNED; XMAP: STD_LOGIC := '0') return UNSIGNED;
|
||||
-- Result subtype: UNSIGNED(S'RANGE)
|
||||
-- Result: Termwise, 'H' is translated to '1', and 'L' is translated
|
||||
-- to '0'. If a value other than '0'|'1'|'H'|'L' is found,
|
||||
-- the array is set to (others => XMAP), and a warning is
|
||||
-- issued.
|
||||
|
||||
-- Id: T.2
|
||||
function TO_01 (S: SIGNED; XMAP: STD_LOGIC := '0') return SIGNED;
|
||||
-- Result subtype: SIGNED(S'RANGE)
|
||||
-- Result: Termwise, 'H' is translated to '1', and 'L' is translated
|
||||
-- to '0'. If a value other than '0'|'1'|'H'|'L' is found,
|
||||
-- the array is set to (others => XMAP), and a warning is
|
||||
-- issued.
|
||||
|
||||
end NUMERIC_STD;
|
||||
@@ -0,0 +1,133 @@
|
||||
-- The sven STANDARD package.
|
||||
-- This design unit contains some special tokens, which are only
|
||||
-- recognized by the analyzer when it is in special "bootstrap" mode.
|
||||
|
||||
package STANDARD is
|
||||
|
||||
-- predefined enumeration types:
|
||||
|
||||
type BOOLEAN is (FALSE, TRUE);
|
||||
|
||||
type BIT is ('0', '1');
|
||||
|
||||
type CHARACTER is (
|
||||
NUL, SOH, STX, ETX, EOT, ENQ, ACK, BEL,
|
||||
BS, HT, LF, VT, FF, CR, SO, SI,
|
||||
DLE, DC1, DC2, DC3, DC4, NAK, SYN, ETB,
|
||||
CAN, EM, SUB, ESC, FSP, GSP, RSP, USP,
|
||||
|
||||
' ', '!', '"', '#', '$', '%', '&', ''',
|
||||
'(', ')', '*', '+', ',', '-', '.', '/',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||
'8', '9', ':', ';', '<', '=', '>', '?',
|
||||
|
||||
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
|
||||
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
|
||||
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
|
||||
'X', 'Y', 'Z', '[', '\', ']', '^', '_',
|
||||
|
||||
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
|
||||
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
|
||||
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
|
||||
'x', 'y', 'z', '{', '|', '}', '~', DEL,
|
||||
C128, C129, C130, C131, C132, C133, C134, C135,
|
||||
C136, C137, C138, C139, C140, C141, C142, C143,
|
||||
C144, C145, C146, C147, C148, C149, C150, C151,
|
||||
C152, C153, C154, C155, C156, C157, C158, C159,
|
||||
' ', '¡', '¢', '£', '¤', '¥', '¦', '§',
|
||||
'¨', '©', 'ª', '«', '¬', '', '®', '¯',
|
||||
'°', '±', '²', '³', '´', 'µ', '¶', '·',
|
||||
'¸', '¹', 'º', '»', '¼', '½', '¾', '¿',
|
||||
'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç',
|
||||
'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï',
|
||||
'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '×',
|
||||
'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'Þ', 'ß',
|
||||
'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç',
|
||||
'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï',
|
||||
'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷',
|
||||
'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ');
|
||||
|
||||
|
||||
|
||||
type SEVERITY_LEVEL is (NOTE, WARNING, ERROR, FAILURE);
|
||||
|
||||
-- predefined numeric types:
|
||||
|
||||
-- Do INTEGER first to aid implicit declarations of "**".
|
||||
type INTEGER is range -2147483647 to 2147483647;
|
||||
|
||||
type $UNIVERSAL_INTEGER is range $- to $+;
|
||||
|
||||
type $UNIVERSAL_REAL is range $-. to $+.;
|
||||
|
||||
function "*" ($LEFT: $UNIVERSAL_REAL; $RIGHT: $UNIVERSAL_INTEGER)
|
||||
return $UNIVERSAL_REAL;
|
||||
|
||||
function "*" ($LEFT: $UNIVERSAL_INTEGER; $RIGHT: $UNIVERSAL_REAL)
|
||||
return $UNIVERSAL_REAL;
|
||||
|
||||
function "/" ($LEFT: $UNIVERSAL_REAL; $RIGHT: $UNIVERSAL_INTEGER)
|
||||
return $UNIVERSAL_REAL;
|
||||
|
||||
type REAL is range $-. to $+.;
|
||||
|
||||
-- predefined type TIME:
|
||||
|
||||
type TIME is range $- to $+
|
||||
units
|
||||
fs; -- femtosecond
|
||||
ps = 1000 fs; -- picosecond
|
||||
ns = 1000 ps; -- nanosecond
|
||||
us = 1000 ns; -- microsecond
|
||||
ms = 1000 us; -- millisecond
|
||||
sec = 1000 ms; -- second
|
||||
min = 60 sec; -- minute
|
||||
hr = 60 min; -- hour;
|
||||
end units;
|
||||
|
||||
-- subtype used internally for checking time expressions for non-negativness:
|
||||
|
||||
subtype $NATURAL_TIME is TIME range 0 sec to TIME'HIGH;
|
||||
|
||||
subtype DELAY_LENGTH is TIME range 0 fs to TIME'HIGH;
|
||||
|
||||
-- function that returns the current simulation time:
|
||||
|
||||
impure function NOW return TIME;
|
||||
|
||||
-- predefined numeric subtypes:
|
||||
|
||||
subtype NATURAL is INTEGER range 0 to INTEGER'HIGH;
|
||||
|
||||
subtype POSITIVE is INTEGER range 1 to INTEGER'HIGH;
|
||||
|
||||
-- predefined array types:
|
||||
|
||||
type STRING is array (POSITIVE range <>) of CHARACTER;
|
||||
|
||||
type BIT_VECTOR is array (NATURAL range <>) of BIT;
|
||||
|
||||
--type FILE_OPEN_KIND is (READ_OPEN, WRITE_OPEN, APPEND_OPEN);
|
||||
|
||||
type FILE_OPEN_KIND is (READ_MODE, WRITE_MODE, APPEND_MODE);
|
||||
|
||||
type FILE_OPEN_STATUS is (OPEN_OK, STATUS_ERROR, NAME_ERROR, MODE_ERROR);
|
||||
|
||||
attribute FOREIGN: STRING;
|
||||
|
||||
--
|
||||
-- The rest of this package is SVEN specific stuff required to make
|
||||
-- this implementation go.
|
||||
-- Note that all things are declared use leading $ characters, so we don't
|
||||
-- trample the user's name space.
|
||||
--
|
||||
|
||||
attribute $BUILTIN: BOOLEAN;
|
||||
|
||||
procedure $RTINDEX (I: NATURAL; FIRSTARG: INTEGER; PASSAP,SAVEFREGS: BOOLEAN);
|
||||
procedure $RTSYMBOL (S: STRING; FIRSTARG: INTEGER; PASSAP,SAVEFREGS: BOOLEAN);
|
||||
|
||||
attribute $BUILTIN of all: function is TRUE;
|
||||
attribute $BUILTIN of all: procedure is TRUE;
|
||||
|
||||
end STANDARD;
|
||||
@@ -0,0 +1,178 @@
|
||||
-- --------------------------------------------------------------------
|
||||
--
|
||||
-- Title : std_logic_1164 multi-value logic system
|
||||
-- Library : This package shall be compiled into a library
|
||||
-- : symbolically named IEEE.
|
||||
-- :
|
||||
-- Developers: IEEE model standards group (par 1164)
|
||||
-- Purpose : This packages defines a standard for designers
|
||||
-- : to use in describing the interconnection data types
|
||||
-- : used in vhdl modeling.
|
||||
-- :
|
||||
-- Limitation: The logic system defined in this package may
|
||||
-- : be insufficient for modeling switched transistors,
|
||||
-- : since such a requirement is out of the scope of this
|
||||
-- : effort. Furthermore, mathematics, primitives,
|
||||
-- : timing standards, etc. are considered orthogonal
|
||||
-- : issues as it relates to this package and are therefore
|
||||
-- : beyond the scope of this effort.
|
||||
-- :
|
||||
-- Note : No declarations or definitions shall be included in,
|
||||
-- : or excluded from this package. The "package declaration"
|
||||
-- : defines the types, subtypes and declarations of
|
||||
-- : std_logic_1164. The std_logic_1164 package body shall be
|
||||
-- : considered the formal definition of the semantics of
|
||||
-- : this package. Tool developers may choose to implement
|
||||
-- : the package body in the most efficient manner available
|
||||
-- : to them.
|
||||
-- :
|
||||
-- --------------------------------------------------------------------
|
||||
-- modification history :
|
||||
-- --------------------------------------------------------------------
|
||||
-- version | mod. date:|
|
||||
-- v4.200 | 01/02/92 |
|
||||
-- --------------------------------------------------------------------
|
||||
|
||||
PACKAGE std_logic_1164 IS
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- logic state system (unresolved)
|
||||
-------------------------------------------------------------------
|
||||
TYPE std_ulogic IS ( 'U', -- Uninitialized
|
||||
'X', -- Forcing Unknown
|
||||
'0', -- Forcing 0
|
||||
'1', -- Forcing 1
|
||||
'Z', -- High Impedance
|
||||
'W', -- Weak Unknown
|
||||
'L', -- Weak 0
|
||||
'H', -- Weak 1
|
||||
'-' -- Don't care
|
||||
);
|
||||
-------------------------------------------------------------------
|
||||
-- unconstrained array of std_ulogic for use with the resolution function
|
||||
-------------------------------------------------------------------
|
||||
TYPE std_ulogic_vector IS ARRAY ( NATURAL RANGE <> ) OF std_ulogic;
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- resolution function
|
||||
-------------------------------------------------------------------
|
||||
FUNCTION resolved ( s : std_ulogic_vector ) RETURN std_ulogic;
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- *** industry standard logic type ***
|
||||
-------------------------------------------------------------------
|
||||
SUBTYPE std_logic IS resolved std_ulogic;
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- unconstrained array of std_logic for use in declaring signal arrays
|
||||
-------------------------------------------------------------------
|
||||
TYPE std_logic_vector IS ARRAY ( NATURAL RANGE <>) OF std_logic;
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- common subtypes
|
||||
-------------------------------------------------------------------
|
||||
SUBTYPE X01 IS resolved std_ulogic RANGE 'X' TO '1'; -- ('X','0','1')
|
||||
SUBTYPE X01Z IS resolved std_ulogic RANGE 'X' TO 'Z'; -- ('X','0','1','Z')
|
||||
SUBTYPE UX01 IS resolved std_ulogic RANGE 'U' TO '1'; -- ('U','X','0','1')
|
||||
SUBTYPE UX01Z IS resolved std_ulogic RANGE 'U' TO 'Z'; -- ('U','X','0','1','Z')
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- overloaded logical operators
|
||||
-------------------------------------------------------------------
|
||||
|
||||
FUNCTION "and" ( l : std_ulogic; r : std_ulogic ) RETURN UX01;
|
||||
FUNCTION "nand" ( l : std_ulogic; r : std_ulogic ) RETURN UX01;
|
||||
FUNCTION "or" ( l : std_ulogic; r : std_ulogic ) RETURN UX01;
|
||||
FUNCTION "nor" ( l : std_ulogic; r : std_ulogic ) RETURN UX01;
|
||||
FUNCTION "xor" ( l : std_ulogic; r : std_ulogic ) RETURN UX01;
|
||||
function "xnor" ( l : std_ulogic; r : std_ulogic ) return ux01;
|
||||
FUNCTION "not" ( l : std_ulogic ) RETURN UX01;
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- vectorized overloaded logical operators
|
||||
-------------------------------------------------------------------
|
||||
FUNCTION "and" ( l, r : std_logic_vector ) RETURN std_logic_vector;
|
||||
FUNCTION "and" ( l, r : std_ulogic_vector ) RETURN std_ulogic_vector;
|
||||
|
||||
FUNCTION "nand" ( l, r : std_logic_vector ) RETURN std_logic_vector;
|
||||
FUNCTION "nand" ( l, r : std_ulogic_vector ) RETURN std_ulogic_vector;
|
||||
|
||||
FUNCTION "or" ( l, r : std_logic_vector ) RETURN std_logic_vector;
|
||||
FUNCTION "or" ( l, r : std_ulogic_vector ) RETURN std_ulogic_vector;
|
||||
|
||||
FUNCTION "nor" ( l, r : std_logic_vector ) RETURN std_logic_vector;
|
||||
FUNCTION "nor" ( l, r : std_ulogic_vector ) RETURN std_ulogic_vector;
|
||||
|
||||
FUNCTION "xor" ( l, r : std_logic_vector ) RETURN std_logic_vector;
|
||||
FUNCTION "xor" ( l, r : std_ulogic_vector ) RETURN std_ulogic_vector;
|
||||
|
||||
-- -----------------------------------------------------------------------
|
||||
-- Note : The declaration and implementation of the "xnor" function is
|
||||
-- specifically commented until at which time the VHDL language has been
|
||||
-- officially adopted as containing such a function. At such a point,
|
||||
-- the following comments may be removed along with this notice without
|
||||
-- further "official" ballotting of this std_logic_1164 package. It is
|
||||
-- the intent of this effort to provide such a function once it becomes
|
||||
-- available in the VHDL standard.
|
||||
-- -----------------------------------------------------------------------
|
||||
function "xnor" ( l, r : std_logic_vector ) return std_logic_vector;
|
||||
function "xnor" ( l, r : std_ulogic_vector ) return std_ulogic_vector;
|
||||
|
||||
FUNCTION "not" ( l : std_logic_vector ) RETURN std_logic_vector;
|
||||
FUNCTION "not" ( l : std_ulogic_vector ) RETURN std_ulogic_vector;
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- conversion functions
|
||||
-------------------------------------------------------------------
|
||||
FUNCTION To_bit ( s : std_ulogic; xmap : BIT := '0')
|
||||
RETURN BIT;
|
||||
FUNCTION To_bitvector ( s : std_logic_vector ; xmap : BIT := '0')
|
||||
RETURN BIT_VECTOR;
|
||||
FUNCTION To_bitvector ( s : std_ulogic_vector; xmap : BIT := '0')
|
||||
RETURN BIT_VECTOR;
|
||||
|
||||
FUNCTION To_StdULogic (b : BIT ) RETURN std_ulogic;
|
||||
FUNCTION To_StdLogicVector (b : BIT_VECTOR ) RETURN std_logic_vector;
|
||||
FUNCTION To_StdLogicVector (s : std_ulogic_vector) RETURN std_logic_vector;
|
||||
FUNCTION To_StdULogicVector(b : BIT_VECTOR ) RETURN std_ulogic_vector;
|
||||
FUNCTION To_StdULogicVector(s : std_logic_vector) RETURN std_ulogic_vector;
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- strength strippers and type convertors
|
||||
-------------------------------------------------------------------
|
||||
|
||||
FUNCTION To_X01 ( s : std_logic_vector ) RETURN std_logic_vector;
|
||||
FUNCTION To_X01 ( s : std_ulogic_vector ) RETURN std_ulogic_vector;
|
||||
FUNCTION To_X01 ( s : std_ulogic ) RETURN X01;
|
||||
FUNCTION To_X01 ( b : BIT_VECTOR ) RETURN std_logic_vector;
|
||||
FUNCTION To_X01 ( b : BIT_VECTOR ) RETURN std_ulogic_vector;
|
||||
FUNCTION To_X01 ( b : BIT ) RETURN X01;
|
||||
|
||||
FUNCTION To_X01Z ( s : std_logic_vector ) RETURN std_logic_vector;
|
||||
FUNCTION To_X01Z ( s : std_ulogic_vector ) RETURN std_ulogic_vector;
|
||||
FUNCTION To_X01Z ( s : std_ulogic ) RETURN X01Z;
|
||||
FUNCTION To_X01Z ( b : BIT_VECTOR ) RETURN std_logic_vector;
|
||||
FUNCTION To_X01Z ( b : BIT_VECTOR ) RETURN std_ulogic_vector;
|
||||
FUNCTION To_X01Z ( b : BIT ) RETURN X01Z;
|
||||
|
||||
FUNCTION To_UX01 ( s : std_logic_vector ) RETURN std_logic_vector;
|
||||
FUNCTION To_UX01 ( s : std_ulogic_vector ) RETURN std_ulogic_vector;
|
||||
FUNCTION To_UX01 ( s : std_ulogic ) RETURN UX01;
|
||||
FUNCTION To_UX01 ( b : BIT_VECTOR ) RETURN std_logic_vector;
|
||||
FUNCTION To_UX01 ( b : BIT_VECTOR ) RETURN std_ulogic_vector;
|
||||
FUNCTION To_UX01 ( b : BIT ) RETURN UX01;
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- edge detection
|
||||
-------------------------------------------------------------------
|
||||
FUNCTION rising_edge (SIGNAL s : std_ulogic) RETURN BOOLEAN;
|
||||
FUNCTION falling_edge (SIGNAL s : std_ulogic) RETURN BOOLEAN;
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- object contains an unknown
|
||||
-------------------------------------------------------------------
|
||||
FUNCTION Is_X ( s : std_ulogic_vector ) RETURN BOOLEAN;
|
||||
FUNCTION Is_X ( s : std_logic_vector ) RETURN BOOLEAN;
|
||||
FUNCTION Is_X ( s : std_ulogic ) RETURN BOOLEAN;
|
||||
|
||||
END std_logic_1164;
|
||||
@@ -0,0 +1,217 @@
|
||||
-- --------------------------------------------------------------------
|
||||
--
|
||||
-- Title : STD_LOGIC_ARITH arithmetic support for STD_ULOGIC/
|
||||
-- : STD_LOGIC_VECTOR data type
|
||||
-- Library : This package shall be compiled into a logical library
|
||||
-- : named IEEE.
|
||||
-- Purpose : To support unsigned arithmetic operations such as
|
||||
-- : addition, subtraction, multiplication etc. for std_ulogic
|
||||
-- : and std_logic_vector data types. Besides it supports
|
||||
-- : functions and operators for Conditional operations,
|
||||
-- : shift operations, relational operation between integer
|
||||
-- : and std_logic_vector types, aligning size between operands
|
||||
-- : of different sizes, type conversion.
|
||||
-- : It also supports a set of arithemtic, conversion, and
|
||||
-- : comparison functions for SIGNED, UNSIGNED, SMALL_INT,
|
||||
-- : INTEGER, STD_ULOGIC, STD_LOGIC, and STD_LOGIC_VECTOR.
|
||||
-- :
|
||||
-- Note : No declarations or definitions shall be included in,
|
||||
-- : or excluded from this package.
|
||||
-- :
|
||||
-- : Modification History: TH, 24th Jan., 1994
|
||||
-- : Following functions are overloaded for STD_ULOGIC_VECTOR
|
||||
-- : type: "+", "-", "*", "cond_op", "<", ">", "<=", ">=", "=",
|
||||
-- : "/=", sh_left, sh_right, align_size and "to_integer"
|
||||
-- : New functions added are:
|
||||
-- : To_StdUlogicVector (oper: INTEGER; length: NATURAL)
|
||||
-- : return STD_ULOGIC_VECTOR
|
||||
-- : "+"(op1: STD_ULOGIC; op2: STD_ULOGIC) return STD_ULOGIC;
|
||||
-- : "-"(op1: STD_ULOGIC; op2: STD_ULOGIC) return STD_ULOGIC;
|
||||
--
|
||||
-- : Name changes from STD_LOGIC_ARITH to STD_LOGIC_ARITH
|
||||
-- : operator "/" added.
|
||||
-- : Vinaya: 13/9/94.
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
|
||||
|
||||
package STD_LOGIC_ARITH is
|
||||
|
||||
-- ADD/SUBTRACT OPERATORS
|
||||
|
||||
function "+"(op1, op2: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "+"(op1: STD_LOGIC_VECTOR; op2: STD_ULOGIC)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function "+"(op1: STD_ULOGIC; op2: STD_LOGIC_VECTOR)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function "+"(op1: INTEGER; op2: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "+"(op1: STD_LOGIC_VECTOR; op2: INTEGER) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "+"(op1, op2: STD_ULOGIC_VECTOR) return STD_ULOGIC_VECTOR;
|
||||
function "+"(op1: STD_ULOGIC_VECTOR; op2: STD_ULOGIC)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
function "+"(op1: STD_ULOGIC; op2: STD_ULOGIC_VECTOR)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
function "+"(op1: INTEGER; op2: STD_ULOGIC_VECTOR)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
function "+"(op1: STD_ULOGIC_VECTOR; op2: INTEGER)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
function "+"(op1, op2 : STD_ULOGIC) return STD_ULOGIC;
|
||||
|
||||
|
||||
function "-"(op1, op2: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "-"(op1: STD_LOGIC_VECTOR; op2: STD_ULOGIC)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function "-"(op1: STD_ULOGIC; op2: STD_LOGIC_VECTOR)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function "-"(op1: INTEGER; op2: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "-"(op1: STD_LOGIC_VECTOR; op2: INTEGER) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "-"(op1, op2: STD_ULOGIC_VECTOR) return STD_ULOGIC_VECTOR;
|
||||
function "-"(op1: STD_ULOGIC_VECTOR; op2: STD_ULOGIC)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
function "-"(op1: STD_ULOGIC; op2: STD_ULOGIC_VECTOR)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
function "-"(op1: INTEGER; op2: STD_ULOGIC_VECTOR)return STD_ULOGIC_VECTOR;
|
||||
function "-"(op1: STD_ULOGIC_VECTOR; op2: INTEGER)return STD_ULOGIC_VECTOR;
|
||||
function "-"(op1, op2 : STD_ULOGIC) return STD_ULOGIC;
|
||||
|
||||
-- UNARY OPERATORS
|
||||
|
||||
function "+" (op1: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "+" (op1: STD_ULOGIC_VECTOR) return STD_ULOGIC_VECTOR;
|
||||
|
||||
-- MULTIPLYING OPERATORS
|
||||
|
||||
function "*" (op1, op2 : STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "*" (op1: STD_ULOGIC; op2 : STD_LOGIC_VECTOR)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function "*" (op1: STD_LOGIC_VECTOR; op2 : STD_ULOGIC)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function "*" (op1, op2 : STD_ULOGIC) return STD_ULOGIC;
|
||||
|
||||
function "*" (op1, op2 : STD_ULOGIC_VECTOR) return STD_ULOGIC_VECTOR;
|
||||
function "*" (op1: STD_ULOGIC; op2 : STD_ULOGIC_VECTOR)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
function "*" (op1: STD_ULOGIC_VECTOR; op2 : STD_ULOGIC)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
|
||||
-- DIVISION OPERATORS
|
||||
-- The division operators are only for internal use
|
||||
-- It is not advisible to use them in design.
|
||||
|
||||
function "/" (op1, op2 : STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "/" (op1: STD_LOGIC_VECTOR; op2 : STD_ULOGIC)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function "/" (op1: STD_ULOGIC; op2 : STD_LOGIC_VECTOR)
|
||||
return STD_ULOGIC;
|
||||
function "/" (op1, op2 : STD_ULOGIC) return STD_ULOGIC;
|
||||
|
||||
|
||||
-- CONDITIONAL FUNCTIONS
|
||||
|
||||
function cond_op (cond : boolean; left_val, right_val: STD_LOGIC_VECTOR)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function cond_op (cond : boolean; left_val, right_val: STD_ULOGIC)
|
||||
return STD_ULOGIC;
|
||||
function cond_op (cond : boolean; left_val, right_val: STD_ULOGIC_VECTOR)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
|
||||
-- RELATIONAL OPERATORS
|
||||
|
||||
function "<"(op1: INTEGER; op2: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function "<"(op1: STD_LOGIC_VECTOR; op2: INTEGER) return BOOLEAN;
|
||||
|
||||
function "<="(op1: INTEGER; op2: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function "<="(op1: STD_LOGIC_VECTOR; op2: INTEGER) return BOOLEAN;
|
||||
|
||||
function ">"(op1: INTEGER; op2: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function ">"(op1: STD_LOGIC_VECTOR; op2: INTEGER) return BOOLEAN;
|
||||
|
||||
function ">="(op1: INTEGER; op2: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function ">="(op1: STD_LOGIC_VECTOR; op2: INTEGER) return BOOLEAN;
|
||||
|
||||
function "="(op1: INTEGER; op2: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function "="(op1: STD_LOGIC_VECTOR; op2: INTEGER) return BOOLEAN;
|
||||
|
||||
function "/="(op1: INTEGER; op2: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function "/="(op1: STD_LOGIC_VECTOR; op2: INTEGER) return BOOLEAN;
|
||||
|
||||
|
||||
function "<"(op1: INTEGER; op2: STD_ULOGIC_VECTOR) return BOOLEAN;
|
||||
function "<"(op1: STD_ULOGIC_VECTOR; op2: INTEGER) return BOOLEAN;
|
||||
|
||||
function "<="(op1: INTEGER; op2: STD_ULOGIC_VECTOR) return BOOLEAN;
|
||||
function "<="(op1: STD_ULOGIC_VECTOR; op2: INTEGER) return BOOLEAN;
|
||||
|
||||
function ">"(op1: INTEGER; op2: STD_ULOGIC_VECTOR) return BOOLEAN;
|
||||
function ">"(op1: STD_ULOGIC_VECTOR; op2: INTEGER) return BOOLEAN;
|
||||
|
||||
function ">="(op1: INTEGER; op2: STD_ULOGIC_VECTOR) return BOOLEAN;
|
||||
function ">="(op1: STD_ULOGIC_VECTOR; op2: INTEGER) return BOOLEAN;
|
||||
|
||||
function "="(op1: INTEGER; op2: STD_ULOGIC_VECTOR) return BOOLEAN;
|
||||
function "="(op1: STD_ULOGIC_VECTOR; op2: INTEGER) return BOOLEAN;
|
||||
|
||||
function "/="(op1: INTEGER; op2: STD_ULOGIC_VECTOR) return BOOLEAN;
|
||||
function "/="(op1: STD_ULOGIC_VECTOR; op2: INTEGER) return BOOLEAN;
|
||||
|
||||
-- SHIFT OPERATORS
|
||||
|
||||
function sh_left(op1: STD_LOGIC_VECTOR; op2: NATURAL)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function sh_right(op1: STD_LOGIC_VECTOR; op2: NATURAL)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function sh_left(op1: STD_ULOGIC_VECTOR; op2: NATURAL)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
function sh_right(op1: STD_ULOGIC_VECTOR; op2: NATURAL)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
|
||||
|
||||
-- FUNCTIONS TO ALLOW ASSIGNMENTS OF STD_LOGIC_VECTOR OF UNEQUAL SIZES
|
||||
|
||||
|
||||
function align_size (oper : STD_LOGIC_VECTOR; size : NATURAL)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function align_size (oper : STD_ULOGIC; size : NATURAL)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function align_size (oper : STD_ULOGIC_VECTOR; size : NATURAL)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
function align_size (oper : STD_ULOGIC; size : NATURAL)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
|
||||
-- CONVERSION TO INTEGER FROM STD_LOGIC AND STD_LOGIC_VECTOR
|
||||
|
||||
function to_integer (oper : STD_LOGIC_VECTOR) return INTEGER;
|
||||
function to_integer (oper: STD_ULOGIC) return INTEGER;
|
||||
function to_integer (oper : STD_ULOGIC_VECTOR) return INTEGER;
|
||||
|
||||
|
||||
-- CONVERSION TO STD_LOGIC_VECTOR FROM INTEGER
|
||||
|
||||
function To_StdLogicVector (oper: INTEGER; length: NATURAL)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function To_StdUlogicVector (oper: INTEGER; length: NATURAL)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
|
||||
-- UTILITY FUNCTIONS
|
||||
|
||||
function drive (V: STD_LOGIC_VECTOR) return STD_ULOGIC_VECTOR;
|
||||
function drive (V: STD_ULOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
|
||||
function Sense (V: STD_ULOGIC; vZ, vU, vDC: STD_ULOGIC) return STD_ULOGIC;
|
||||
function Sense (V: STD_ULOGIC_VECTOR; vZ, vU, vDC: STD_ULOGIC)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
function Sense (V: STD_LOGIC_VECTOR; vZ, vU, vDC: STD_ULOGIC)
|
||||
return STD_ULOGIC_VECTOR;
|
||||
|
||||
-- CONVERSION TABLE FOR TO_INTEGER
|
||||
|
||||
type tbl_type is array (STD_ULOGIC) of STD_ULOGIC;
|
||||
constant tbl_BINARY : tbl_type :=
|
||||
('X', 'X', '0', '1', 'X', 'X', '0', '1', 'X');
|
||||
|
||||
end STD_LOGIC_ARITH;
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
--------------------------------------------------------------------------
|
||||
-- --
|
||||
-- Copyright (c) 1990,1991,1992 by Synopsys, Inc. All rights reserved. --
|
||||
-- --
|
||||
-- This source file may be used and distributed without restriction --
|
||||
-- provided that this copyright statement is not removed from the file --
|
||||
-- and that any derivative work contains this copyright notice. --
|
||||
-- --
|
||||
-- Package name: STD_LOGIC_ARITH --
|
||||
-- --
|
||||
-- Purpose: --
|
||||
-- A set of arithemtic, conversion, and comparison functions --
|
||||
-- for SIGNED, UNSIGNED, SMALL_INT, INTEGER, --
|
||||
-- STD_ULOGIC, STD_LOGIC, and STD_LOGIC_VECTOR. --
|
||||
-- --
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
|
||||
package std_logic_arith is
|
||||
|
||||
type UNSIGNED is array (NATURAL range <>) of STD_LOGIC;
|
||||
type SIGNED is array (NATURAL range <>) of STD_LOGIC;
|
||||
subtype SMALL_INT is INTEGER range 0 to 1;
|
||||
|
||||
function "+"(L: UNSIGNED; R: UNSIGNED) return UNSIGNED;
|
||||
function "+"(L: SIGNED; R: SIGNED) return SIGNED;
|
||||
function "+"(L: UNSIGNED; R: SIGNED) return SIGNED;
|
||||
function "+"(L: SIGNED; R: UNSIGNED) return SIGNED;
|
||||
function "+"(L: UNSIGNED; R: INTEGER) return UNSIGNED;
|
||||
function "+"(L: INTEGER; R: UNSIGNED) return UNSIGNED;
|
||||
function "+"(L: SIGNED; R: INTEGER) return SIGNED;
|
||||
function "+"(L: INTEGER; R: SIGNED) return SIGNED;
|
||||
function "+"(L: UNSIGNED; R: STD_ULOGIC) return UNSIGNED;
|
||||
function "+"(L: STD_ULOGIC; R: UNSIGNED) return UNSIGNED;
|
||||
function "+"(L: SIGNED; R: STD_ULOGIC) return SIGNED;
|
||||
function "+"(L: STD_ULOGIC; R: SIGNED) return SIGNED;
|
||||
|
||||
function "+"(L: UNSIGNED; R: UNSIGNED) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: SIGNED; R: SIGNED) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: UNSIGNED; R: SIGNED) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: SIGNED; R: UNSIGNED) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: UNSIGNED; R: INTEGER) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: INTEGER; R: UNSIGNED) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: SIGNED; R: INTEGER) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: INTEGER; R: SIGNED) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: UNSIGNED; R: STD_ULOGIC) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: STD_ULOGIC; R: UNSIGNED) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: SIGNED; R: STD_ULOGIC) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: STD_ULOGIC; R: SIGNED) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "-"(L: UNSIGNED; R: UNSIGNED) return UNSIGNED;
|
||||
function "-"(L: SIGNED; R: SIGNED) return SIGNED;
|
||||
function "-"(L: UNSIGNED; R: SIGNED) return SIGNED;
|
||||
function "-"(L: SIGNED; R: UNSIGNED) return SIGNED;
|
||||
function "-"(L: UNSIGNED; R: INTEGER) return UNSIGNED;
|
||||
function "-"(L: INTEGER; R: UNSIGNED) return UNSIGNED;
|
||||
function "-"(L: SIGNED; R: INTEGER) return SIGNED;
|
||||
function "-"(L: INTEGER; R: SIGNED) return SIGNED;
|
||||
function "-"(L: UNSIGNED; R: STD_ULOGIC) return UNSIGNED;
|
||||
function "-"(L: STD_ULOGIC; R: UNSIGNED) return UNSIGNED;
|
||||
function "-"(L: SIGNED; R: STD_ULOGIC) return SIGNED;
|
||||
function "-"(L: STD_ULOGIC; R: SIGNED) return SIGNED;
|
||||
|
||||
function "-"(L: UNSIGNED; R: UNSIGNED) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: SIGNED; R: SIGNED) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: UNSIGNED; R: SIGNED) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: SIGNED; R: UNSIGNED) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: UNSIGNED; R: INTEGER) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: INTEGER; R: UNSIGNED) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: SIGNED; R: INTEGER) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: INTEGER; R: SIGNED) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: UNSIGNED; R: STD_ULOGIC) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: STD_ULOGIC; R: UNSIGNED) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: SIGNED; R: STD_ULOGIC) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: STD_ULOGIC; R: SIGNED) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "+"(L: UNSIGNED) return UNSIGNED;
|
||||
function "+"(L: SIGNED) return SIGNED;
|
||||
function "-"(L: SIGNED) return SIGNED;
|
||||
function "ABS"(L: SIGNED) return SIGNED;
|
||||
|
||||
function "+"(L: UNSIGNED) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: SIGNED) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: SIGNED) return STD_LOGIC_VECTOR;
|
||||
function "ABS"(L: SIGNED) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "*"(L: UNSIGNED; R: UNSIGNED) return UNSIGNED;
|
||||
function "*"(L: SIGNED; R: SIGNED) return SIGNED;
|
||||
function "*"(L: SIGNED; R: UNSIGNED) return SIGNED;
|
||||
function "*"(L: UNSIGNED; R: SIGNED) return SIGNED;
|
||||
|
||||
function "*"(L: UNSIGNED; R: UNSIGNED) return STD_LOGIC_VECTOR;
|
||||
function "*"(L: SIGNED; R: SIGNED) return STD_LOGIC_VECTOR;
|
||||
function "*"(L: SIGNED; R: UNSIGNED) return STD_LOGIC_VECTOR;
|
||||
function "*"(L: UNSIGNED; R: SIGNED) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "<"(L: UNSIGNED; R: UNSIGNED) return BOOLEAN;
|
||||
function "<"(L: SIGNED; R: SIGNED) return BOOLEAN;
|
||||
function "<"(L: UNSIGNED; R: SIGNED) return BOOLEAN;
|
||||
function "<"(L: SIGNED; R: UNSIGNED) return BOOLEAN;
|
||||
function "<"(L: UNSIGNED; R: INTEGER) return BOOLEAN;
|
||||
function "<"(L: INTEGER; R: UNSIGNED) return BOOLEAN;
|
||||
function "<"(L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
function "<"(L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
|
||||
function "<="(L: UNSIGNED; R: UNSIGNED) return BOOLEAN;
|
||||
function "<="(L: SIGNED; R: SIGNED) return BOOLEAN;
|
||||
function "<="(L: UNSIGNED; R: SIGNED) return BOOLEAN;
|
||||
function "<="(L: SIGNED; R: UNSIGNED) return BOOLEAN;
|
||||
function "<="(L: UNSIGNED; R: INTEGER) return BOOLEAN;
|
||||
function "<="(L: INTEGER; R: UNSIGNED) return BOOLEAN;
|
||||
function "<="(L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
function "<="(L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
|
||||
function ">"(L: UNSIGNED; R: UNSIGNED) return BOOLEAN;
|
||||
function ">"(L: SIGNED; R: SIGNED) return BOOLEAN;
|
||||
function ">"(L: UNSIGNED; R: SIGNED) return BOOLEAN;
|
||||
function ">"(L: SIGNED; R: UNSIGNED) return BOOLEAN;
|
||||
function ">"(L: UNSIGNED; R: INTEGER) return BOOLEAN;
|
||||
function ">"(L: INTEGER; R: UNSIGNED) return BOOLEAN;
|
||||
function ">"(L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
function ">"(L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
|
||||
function ">="(L: UNSIGNED; R: UNSIGNED) return BOOLEAN;
|
||||
function ">="(L: SIGNED; R: SIGNED) return BOOLEAN;
|
||||
function ">="(L: UNSIGNED; R: SIGNED) return BOOLEAN;
|
||||
function ">="(L: SIGNED; R: UNSIGNED) return BOOLEAN;
|
||||
function ">="(L: UNSIGNED; R: INTEGER) return BOOLEAN;
|
||||
function ">="(L: INTEGER; R: UNSIGNED) return BOOLEAN;
|
||||
function ">="(L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
function ">="(L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
|
||||
function "="(L: UNSIGNED; R: UNSIGNED) return BOOLEAN;
|
||||
function "="(L: SIGNED; R: SIGNED) return BOOLEAN;
|
||||
function "="(L: UNSIGNED; R: SIGNED) return BOOLEAN;
|
||||
function "="(L: SIGNED; R: UNSIGNED) return BOOLEAN;
|
||||
function "="(L: UNSIGNED; R: INTEGER) return BOOLEAN;
|
||||
function "="(L: INTEGER; R: UNSIGNED) return BOOLEAN;
|
||||
function "="(L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
function "="(L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
|
||||
function "/="(L: UNSIGNED; R: UNSIGNED) return BOOLEAN;
|
||||
function "/="(L: SIGNED; R: SIGNED) return BOOLEAN;
|
||||
function "/="(L: UNSIGNED; R: SIGNED) return BOOLEAN;
|
||||
function "/="(L: SIGNED; R: UNSIGNED) return BOOLEAN;
|
||||
function "/="(L: UNSIGNED; R: INTEGER) return BOOLEAN;
|
||||
function "/="(L: INTEGER; R: UNSIGNED) return BOOLEAN;
|
||||
function "/="(L: SIGNED; R: INTEGER) return BOOLEAN;
|
||||
function "/="(L: INTEGER; R: SIGNED) return BOOLEAN;
|
||||
|
||||
function SHL(ARG: UNSIGNED; COUNT: UNSIGNED) return UNSIGNED;
|
||||
function SHL(ARG: SIGNED; COUNT: UNSIGNED) return SIGNED;
|
||||
function SHR(ARG: UNSIGNED; COUNT: UNSIGNED) return UNSIGNED;
|
||||
function SHR(ARG: SIGNED; COUNT: UNSIGNED) return SIGNED;
|
||||
|
||||
function CONV_INTEGER(ARG: INTEGER) return INTEGER;
|
||||
function CONV_INTEGER(ARG: UNSIGNED) return INTEGER;
|
||||
function CONV_INTEGER(ARG: SIGNED) return INTEGER;
|
||||
function CONV_INTEGER(ARG: STD_ULOGIC) return SMALL_INT;
|
||||
|
||||
function CONV_UNSIGNED(ARG: INTEGER; SIZE: INTEGER) return UNSIGNED;
|
||||
function CONV_UNSIGNED(ARG: UNSIGNED; SIZE: INTEGER) return UNSIGNED;
|
||||
function CONV_UNSIGNED(ARG: SIGNED; SIZE: INTEGER) return UNSIGNED;
|
||||
function CONV_UNSIGNED(ARG: STD_ULOGIC; SIZE: INTEGER) return UNSIGNED;
|
||||
|
||||
function CONV_SIGNED(ARG: INTEGER; SIZE: INTEGER) return SIGNED;
|
||||
function CONV_SIGNED(ARG: UNSIGNED; SIZE: INTEGER) return SIGNED;
|
||||
function CONV_SIGNED(ARG: SIGNED; SIZE: INTEGER) return SIGNED;
|
||||
function CONV_SIGNED(ARG: STD_ULOGIC; SIZE: INTEGER) return SIGNED;
|
||||
|
||||
function CONV_STD_LOGIC_VECTOR(ARG: INTEGER; SIZE: INTEGER)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function CONV_STD_LOGIC_VECTOR(ARG: UNSIGNED; SIZE: INTEGER)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function CONV_STD_LOGIC_VECTOR(ARG: SIGNED; SIZE: INTEGER)
|
||||
return STD_LOGIC_VECTOR;
|
||||
function CONV_STD_LOGIC_VECTOR(ARG: STD_ULOGIC; SIZE: INTEGER)
|
||||
return STD_LOGIC_VECTOR;
|
||||
-- zero extend STD_LOGIC_VECTOR (ARG) to SIZE,
|
||||
-- SIZE < 0 is same as SIZE = 0
|
||||
-- returns STD_LOGIC_VECTOR(SIZE-1 downto 0)
|
||||
function EXT(ARG: STD_LOGIC_VECTOR; SIZE: INTEGER) return STD_LOGIC_VECTOR;
|
||||
|
||||
-- sign extend STD_LOGIC_VECTOR (ARG) to SIZE,
|
||||
-- SIZE < 0 is same as SIZE = 0
|
||||
-- return STD_LOGIC_VECTOR(SIZE-1 downto 0)
|
||||
function SXT(ARG: STD_LOGIC_VECTOR; SIZE: INTEGER) return STD_LOGIC_VECTOR;
|
||||
|
||||
end Std_logic_arith;
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
--------------------------------------------------------------------------
|
||||
-- --
|
||||
-- Copyright (c) 1990, 1991, 1992 by Synopsys, Inc. --
|
||||
-- All rights reserved. --
|
||||
-- --
|
||||
-- This source file may be used and distributed without restriction --
|
||||
-- provided that this copyright statement is not removed from the file --
|
||||
-- and that any derivative work contains this copyright notice. --
|
||||
-- --
|
||||
-- Package name: STD_LOGIC_SIGNED --
|
||||
-- --
|
||||
-- --
|
||||
-- Date: 09/11/91 KN --
|
||||
-- 10/08/92 AMT change std_ulogic to signed std_logic --
|
||||
-- 10/28/92 AMT added signed functions, -, ABS --
|
||||
-- --
|
||||
-- Purpose: --
|
||||
-- A set of signed arithemtic, conversion, --
|
||||
-- and comparision functions for STD_LOGIC_VECTOR. --
|
||||
-- --
|
||||
-- Note: Comparision of same length std_logic_vector is defined --
|
||||
-- in the LRM. The interpretation is for unsigned vectors --
|
||||
-- This package will "overload" that definition. --
|
||||
-- --
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
use IEEE.std_logic_arith.all;
|
||||
|
||||
package STD_LOGIC_SIGNED is
|
||||
|
||||
function "+"(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: STD_LOGIC_VECTOR; R: INTEGER) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: INTEGER; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: STD_LOGIC_VECTOR; R: STD_LOGIC) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: STD_LOGIC; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "-"(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: STD_LOGIC_VECTOR; R: INTEGER) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: INTEGER; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: STD_LOGIC_VECTOR; R: STD_LOGIC) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: STD_LOGIC; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "+"(L: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "ABS"(L: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
|
||||
|
||||
function "*"(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "<"(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function "<"(L: STD_LOGIC_VECTOR; R: INTEGER) return BOOLEAN;
|
||||
function "<"(L: INTEGER; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
|
||||
function "<="(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function "<="(L: STD_LOGIC_VECTOR; R: INTEGER) return BOOLEAN;
|
||||
function "<="(L: INTEGER; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
|
||||
function ">"(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function ">"(L: STD_LOGIC_VECTOR; R: INTEGER) return BOOLEAN;
|
||||
function ">"(L: INTEGER; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
|
||||
function ">="(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function ">="(L: STD_LOGIC_VECTOR; R: INTEGER) return BOOLEAN;
|
||||
function ">="(L: INTEGER; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
|
||||
function "="(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function "="(L: STD_LOGIC_VECTOR; R: INTEGER) return BOOLEAN;
|
||||
function "="(L: INTEGER; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
|
||||
function "/="(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function "/="(L: STD_LOGIC_VECTOR; R: INTEGER) return BOOLEAN;
|
||||
function "/="(L: INTEGER; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function SHL(ARG:STD_LOGIC_VECTOR;COUNT: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function SHR(ARG:STD_LOGIC_VECTOR;COUNT: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
|
||||
function CONV_INTEGER(ARG: STD_LOGIC_VECTOR) return INTEGER;
|
||||
|
||||
-- remove this since it is already in std_logic_arith
|
||||
-- function CONV_STD_LOGIC_VECTOR(ARG: INTEGER; SIZE: INTEGER) return STD_LOGIC_VECTOR;
|
||||
|
||||
end STD_LOGIC_SIGNED;
|
||||
@@ -0,0 +1,73 @@
|
||||
--
|
||||
-- Copyright (c) 1990, 1991, 1992 by Synopsys, Inc. All rights reserved.
|
||||
--
|
||||
-- This source file may be used and distributed without restriction
|
||||
-- provided that this copyright statement is not removed from the file
|
||||
-- and that any derivative work contains this copyright notice.
|
||||
--
|
||||
-- Package name: STD_LOGIC_TEXTIO
|
||||
--
|
||||
-- Purpose: This package overloads the standard TEXTIO procedures
|
||||
-- READ and WRITE.
|
||||
--
|
||||
-- Author: CRC, TS
|
||||
--
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
use STD.textio.all;
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
|
||||
package STD_LOGIC_TEXTIO is
|
||||
--synopsys synthesis_off
|
||||
-- Read and Write procedures for STD_ULOGIC and STD_ULOGIC_VECTOR
|
||||
procedure READ(L:inout LINE; VALUE:out STD_ULOGIC);
|
||||
procedure READ(L:inout LINE; VALUE:out STD_ULOGIC; GOOD: out BOOLEAN);
|
||||
procedure READ(L:inout LINE; VALUE:out STD_ULOGIC_VECTOR);
|
||||
procedure READ(L:inout LINE; VALUE:out STD_ULOGIC_VECTOR; GOOD: out
|
||||
BOOLEAN);
|
||||
procedure WRITE(L:inout LINE; VALUE:in STD_ULOGIC;
|
||||
JUSTIFIED:in SIDE := RIGHT; FIELD:in WIDTH := 0);
|
||||
procedure WRITE(L:inout LINE; VALUE:in STD_ULOGIC_VECTOR;
|
||||
JUSTIFIED:in SIDE := RIGHT; FIELD:in WIDTH := 0);
|
||||
|
||||
-- Read and Write procedures for STD_LOGIC_VECTOR
|
||||
procedure READ(L:inout LINE; VALUE:out STD_LOGIC_VECTOR);
|
||||
procedure READ(L:inout LINE; VALUE:out STD_LOGIC_VECTOR; GOOD: out
|
||||
BOOLEAN);
|
||||
procedure WRITE(L:inout LINE; VALUE:in STD_LOGIC_VECTOR;
|
||||
JUSTIFIED:in SIDE := RIGHT; FIELD:in WIDTH := 0);
|
||||
|
||||
--
|
||||
-- Read and Write procedures for Hex and Octal values.
|
||||
-- The values appear in the file as a series of characters
|
||||
-- between 0-F (Hex), or 0-7 (Octal) respectively.
|
||||
--
|
||||
|
||||
-- Hex
|
||||
procedure HREAD(L:inout LINE; VALUE:out STD_ULOGIC_VECTOR);
|
||||
procedure HREAD(L:inout LINE; VALUE:out STD_ULOGIC_VECTOR; GOOD:
|
||||
out BOOLEAN);
|
||||
procedure HWRITE(L:inout LINE; VALUE:in STD_ULOGIC_VECTOR;
|
||||
JUSTIFIED:in SIDE := RIGHT; FIELD:in WIDTH := 0);
|
||||
procedure HREAD(L:inout LINE; VALUE:out STD_LOGIC_VECTOR);
|
||||
procedure HREAD(L:inout LINE; VALUE:out STD_LOGIC_VECTOR; GOOD: out
|
||||
BOOLEAN);
|
||||
procedure HWRITE(L:inout LINE; VALUE:in STD_LOGIC_VECTOR;
|
||||
JUSTIFIED:in SIDE := RIGHT; FIELD:in WIDTH := 0);
|
||||
|
||||
-- Octal
|
||||
procedure OREAD(L:inout LINE; VALUE:out STD_ULOGIC_VECTOR);
|
||||
procedure OREAD(L:inout LINE; VALUE:out STD_ULOGIC_VECTOR; GOOD:
|
||||
out BOOLEAN);
|
||||
procedure OWRITE(L:inout LINE; VALUE:in STD_ULOGIC_VECTOR;
|
||||
JUSTIFIED:in SIDE := RIGHT; FIELD:in WIDTH := 0);
|
||||
procedure OREAD(L:inout LINE; VALUE:out STD_LOGIC_VECTOR);
|
||||
procedure OREAD(L:inout LINE; VALUE:out STD_LOGIC_VECTOR; GOOD: out
|
||||
BOOLEAN);
|
||||
procedure OWRITE(L:inout LINE; VALUE:in STD_LOGIC_VECTOR;
|
||||
JUSTIFIED:in SIDE := RIGHT; FIELD:in WIDTH := 0);
|
||||
|
||||
|
||||
--synopsys synthesis_on
|
||||
end STD_LOGIC_TEXTIO;
|
||||
@@ -0,0 +1,79 @@
|
||||
--------------------------------------------------------------------------
|
||||
-- --
|
||||
-- Copyright (c) 1990, 1991, 1992 by Synopsys, Inc. --
|
||||
-- All rights reserved. --
|
||||
-- --
|
||||
-- This source file may be used and distributed without restriction --
|
||||
-- provided that this copyright statement is not removed from the file --
|
||||
-- and that any derivative work contains this copyright notice. --
|
||||
-- --
|
||||
-- Package name: STD_LOGIC_UNSIGNED --
|
||||
-- --
|
||||
-- --
|
||||
-- Date: 09/11/92 KN --
|
||||
-- 10/08/92 AMT --
|
||||
-- --
|
||||
-- Purpose: --
|
||||
-- A set of unsigned arithemtic, conversion, --
|
||||
-- and comparision functions for STD_LOGIC_VECTOR. --
|
||||
-- --
|
||||
-- Note: comparision of same length discrete arrays is defined --
|
||||
-- by the LRM. This package will "overload" those --
|
||||
-- definitions --
|
||||
-- --
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
use IEEE.std_logic_arith.all;
|
||||
|
||||
package STD_LOGIC_UNSIGNED is
|
||||
|
||||
function "+"(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: STD_LOGIC_VECTOR; R: INTEGER) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: INTEGER; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: STD_LOGIC_VECTOR; R: STD_LOGIC) return STD_LOGIC_VECTOR;
|
||||
function "+"(L: STD_LOGIC; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "-"(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: STD_LOGIC_VECTOR; R: INTEGER) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: INTEGER; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: STD_LOGIC_VECTOR; R: STD_LOGIC) return STD_LOGIC_VECTOR;
|
||||
function "-"(L: STD_LOGIC; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "+"(L: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "*"(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
|
||||
function "<"(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function "<"(L: STD_LOGIC_VECTOR; R: INTEGER) return BOOLEAN;
|
||||
function "<"(L: INTEGER; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
|
||||
function "<="(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function "<="(L: STD_LOGIC_VECTOR; R: INTEGER) return BOOLEAN;
|
||||
function "<="(L: INTEGER; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
|
||||
function ">"(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function ">"(L: STD_LOGIC_VECTOR; R: INTEGER) return BOOLEAN;
|
||||
function ">"(L: INTEGER; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
|
||||
function ">="(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function ">="(L: STD_LOGIC_VECTOR; R: INTEGER) return BOOLEAN;
|
||||
function ">="(L: INTEGER; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
|
||||
function "="(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function "="(L: STD_LOGIC_VECTOR; R: INTEGER) return BOOLEAN;
|
||||
function "="(L: INTEGER; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
|
||||
function "/="(L: STD_LOGIC_VECTOR; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function "/="(L: STD_LOGIC_VECTOR; R: INTEGER) return BOOLEAN;
|
||||
function "/="(L: INTEGER; R: STD_LOGIC_VECTOR) return BOOLEAN;
|
||||
function SHL(ARG:STD_LOGIC_VECTOR;COUNT: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
function SHR(ARG:STD_LOGIC_VECTOR;COUNT: STD_LOGIC_VECTOR) return STD_LOGIC_VECTOR;
|
||||
|
||||
function CONV_INTEGER(ARG: STD_LOGIC_VECTOR) return INTEGER;
|
||||
|
||||
-- remove this since it is already in std_logic_arith
|
||||
-- function CONV_STD_LOGIC_VECTOR(ARG: INTEGER; SIZE: INTEGER) return STD_LOGIC_VECTOR;
|
||||
|
||||
end STD_LOGIC_UNSIGNED;
|
||||
@@ -0,0 +1,86 @@
|
||||
-- textio.vhdl
|
||||
|
||||
library std; use std.standard.all; -- needed for bootstrap mode
|
||||
|
||||
package TEXTIO is
|
||||
|
||||
-- Type Definitions for Text I/O
|
||||
|
||||
type LINE is access STRING; -- a line is a pointer to a STRING value
|
||||
|
||||
type TEXT is file of STRING; -- a file of variable-length ASCII records
|
||||
|
||||
type SIDE is (RIGHT, LEFT); -- for justifying output data within fields
|
||||
|
||||
subtype WIDTH is NATURAL; -- for specifying widths of output fields
|
||||
|
||||
-- Standard Text Files
|
||||
|
||||
file INPUT: TEXT open READ_MODE is "STD_INPUT";
|
||||
|
||||
file OUTPUT: TEXT open WRITE_MODE is "STD_OUTPUT";
|
||||
|
||||
-- Input Routines for Standard Types
|
||||
|
||||
procedure READLINE (file F: TEXT; L: inout LINE);
|
||||
|
||||
procedure READ (L: inout LINE; VALUE: out BIT; GOOD: out BOOLEAN);
|
||||
procedure READ (L: inout LINE; VALUE: out BIT);
|
||||
|
||||
procedure READ (L: inout LINE; VALUE: out BIT_VECTOR; GOOD: out BOOLEAN);
|
||||
procedure READ (L: inout LINE; VALUE: out BIT_VECTOR);
|
||||
|
||||
procedure READ (L: inout LINE; VALUE: out BOOLEAN; GOOD: out BOOLEAN);
|
||||
procedure READ (L: inout LINE; VALUE: out BOOLEAN);
|
||||
|
||||
procedure READ (L: inout LINE; VALUE: out CHARACTER; GOOD: out BOOLEAN);
|
||||
procedure READ (L: inout LINE; VALUE: out CHARACTER);
|
||||
|
||||
procedure READ (L: inout LINE; VALUE: out INTEGER; GOOD: out BOOLEAN);
|
||||
procedure READ (L: inout LINE; VALUE: out INTEGER);
|
||||
|
||||
procedure READ (L: inout LINE; VALUE: out REAL; GOOD: out BOOLEAN);
|
||||
procedure READ (L: inout LINE; VALUE: out REAL);
|
||||
|
||||
procedure READ (L: inout LINE; VALUE: out STRING; GOOD: out BOOLEAN);
|
||||
procedure READ (L: inout LINE; VALUE: out STRING);
|
||||
|
||||
procedure READ (L: inout LINE; VALUE: out TIME; GOOD: out BOOLEAN);
|
||||
procedure READ (L: inout LINE; VALUE: out TIME);
|
||||
|
||||
-- Output Routines for Standard Types
|
||||
|
||||
procedure WRITELINE (file F: TEXT; L: inout LINE);
|
||||
|
||||
procedure WRITE (L: inout LINE; VALUE: in BIT;
|
||||
JUSTIFIED: in SIDE := RIGHT; FIELD: in WIDTH := 0);
|
||||
|
||||
procedure WRITE (L: inout LINE; VALUE: in BIT_VECTOR;
|
||||
JUSTIFIED: in SIDE := RIGHT; FIELD: in WIDTH := 0);
|
||||
|
||||
procedure WRITE (L: inout LINE; VALUE: in BOOLEAN;
|
||||
JUSTIFIED: in SIDE := RIGHT; FIELD: in WIDTH := 0);
|
||||
|
||||
procedure WRITE (L: inout LINE; VALUE: in CHARACTER;
|
||||
JUSTIFIED: in SIDE := RIGHT; FIELD: in WIDTH := 0);
|
||||
|
||||
procedure WRITE (L: inout LINE; VALUE: in INTEGER;
|
||||
JUSTIFIED: in SIDE := RIGHT; FIELD: in WIDTH := 0);
|
||||
|
||||
procedure WRITE (L: inout LINE; VALUE: in REAL;
|
||||
JUSTIFIED: in SIDE := RIGHT; FIELD: in WIDTH := 0;
|
||||
DIGITS: in NATURAL := 0);
|
||||
|
||||
procedure WRITE (L: inout LINE; VALUE: in STRING;
|
||||
JUSTIFIED: in SIDE := RIGHT; FIELD: in WIDTH := 0);
|
||||
|
||||
procedure WRITE (L: inout LINE; VALUE: in TIME;
|
||||
JUSTIFIED: in SIDE := RIGHT; FIELD: in WIDTH := 0;
|
||||
UNIT: in TIME := ns);
|
||||
|
||||
-- File Position Predicates
|
||||
|
||||
function ENDLINE (L: in LINE) return BOOLEAN;
|
||||
|
||||
|
||||
end TEXTIO;
|
||||
Reference in New Issue
Block a user