--****************************************************************************** --** @(#) Design Unit: PACKAGE utilities.standard_utils --** @(#) Part Class: Utilities --** @(#) File: standard_utils_.vhd --** @(#) Version: 1.3 --** @(#) Date: 07/23/98 --** @(#) Description: Subprograms for type conversions between types in --** @(#) Description: std.standard and other support functions associated --** @(#) Description: with package std.standard --** --****************************************************************************** --** File: standard_utils_.vhd --** --** Description: PACKAGE standard_utils --** Subprograms for type conversions between types in std.standard --** and other support functions associated with package std.standard. --** --****************************************************************************** --** History: @(#)standard_utils_.vhd 1.3 07/23/98 --** Version | Who | When | What --** 1.1 | VLS | 01-20-95 | Original (Vince Sanders) --** 1.2 | VLS | 05-08-95 | Added Procedure Skip_White --** 1.3 | VLS | 03-03-97 | Added Maximum, Minimum for Integer, Real --** --****************************************************************************** --** --****************************************************************************** --** --** Organization: --** Microsystems Prototyping Laboratory --** Mississippi State University --** P.O. Box 9627 --** Mississippi State, MS 39762 --** Phone : (601) 325-3670 --** FAX : (601) 325-7692 --** E-Mail : mpl-vhdl@ERC.MsState.Edu --** WWW : http://www.ERC.MsState.Edu/mpl --** --** Disclaimer: --** All information, models, programs, code, etc... --** is provided as-is with no warranty of any kind with regard to this --** material, either expressed or implied, including, but not limited to, --** the implied warranties of merchantability and fitness for a particular --** purpose. --** --** Bug Reports and Information: --** Please report all bugs/fixes/problems/comments to the --** above organization. If you would like to be put on the --** mailing list for updates/bug fixes/etc... and future model --** releases please send email to the above organization. --** --****************************************************************************** LIBRARY std; USE std.textio.ALL; PACKAGE standard_utils IS --############################################################################## -- Conversions FROM std.standard TO std.standard --############################################################################## -------------------------------------------------------------------------------- -- To_Bit -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ FUNCTION To_Bit (v : Boolean) RETURN Bit; FUNCTION To_Bit (v : Character; xmap : Bit := '0') RETURN Bit; FUNCTION To_Bit (v : String; xmap : Bit := '0') RETURN Bit; ------------------------------------------------------------------------------ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- To_Bit_Vector -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ FUNCTION To_Bit_Vector (v : Integer; length : Positive) RETURN Bit_Vector; FUNCTION To_Bit_Vector (v : String; xmap : Bit := '0') RETURN Bit_Vector; ------------------------------------------------------------------------------ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- To_Boolean -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ FUNCTION To_Boolean (v : Bit) RETURN Boolean; ------------------------------------------------------------------------------ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- To_Character -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ FUNCTION To_Character (v : Bit) RETURN Character; FUNCTION To_Character (v : Boolean) RETURN Character; ------------------------------------------------------------------------------ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- To_Integer -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ FUNCTION To_Integer (v : Bit) RETURN Integer; FUNCTION To_Integer (v : Bit_Vector) RETURN Integer; --??FUNCTION To_Integer (v : Character) RETURN Integer; ------------------------------------------------------------------------------ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- To_String -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ FUNCTION To_String (v : Bit) RETURN String; FUNCTION To_String (v : Bit_Vector) RETURN String; FUNCTION To_String (v : Boolean) RETURN String; FUNCTION To_String (v : Integer) RETURN String; FUNCTION To_String (v : Real) RETURN String; FUNCTION To_String (v : Time) RETURN String; ------------------------------------------------------------------------------ -------------------------------------------------------------------------------- --############################################################################## -- Misc Functions & Procedures --############################################################################## -------------------------------------------------------------------------------- -- Skip_White -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ PROCEDURE Skip_White (l : INOUT Line); ------------------------------------------------------------------------------ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Maximum, Minimum Functions -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ FUNCTION Maximum (x, y : Integer) RETURN Integer; FUNCTION Minimum (x, y : Integer) RETURN Integer; FUNCTION Maximum (x, y : Real) RETURN Real; FUNCTION Minimum (x, y : Real) RETURN Real; FUNCTION Maximum (x, y : Time) RETURN Time; FUNCTION Minimum (x, y : Time) RETURN Time; ------------------------------------------------------------------------------ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- To_Logic -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ FUNCTION To_Logic (v : Character; xmap : Bit := '0') RETURN Bit; FUNCTION To_Logic (v : String; xmap : Bit := '0') RETURN Bit; FUNCTION To_Logic (v : String; xmap : Bit := '0') RETURN Bit_Vector; ------------------------------------------------------------------------------ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Reduce Logic Functions -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ FUNCTION Reduce_AND (v : Bit_Vector) RETURN Bit; FUNCTION Reduce_OR (v : Bit_Vector) RETURN Bit; FUNCTION Reduce_XOR (v : Bit_Vector) RETURN Bit; ------------------------------------------------------------------------------ -------------------------------------------------------------------------------- END standard_utils;