1 |
9 |
eejlny |
-------------------------------------------------------------------------------
|
2 |
|
|
--
|
3 |
|
|
-- Copyright (c) 1994 by AT&T. All rights reserved.
|
4 |
|
|
--
|
5 |
|
|
-- This source file may be used and distributed without restriction
|
6 |
|
|
-- provided that this copyright statement is not removed from the file
|
7 |
|
|
-- and that any derivative work contains this copyright notice.
|
8 |
|
|
--
|
9 |
|
|
-- Package name: BIT_UTILS
|
10 |
|
|
-- File name : bit_utils.vhdl
|
11 |
|
|
--
|
12 |
|
|
-- Updates:
|
13 |
|
|
|
14 |
|
|
--D sccsid @(#)bit_utils.vhdl 1.2 daisy(C) 2/13/95 /files1/SCCS.model/bvhdl/vhdl_packages/dzx/src/s.bit_utils.vhdl
|
15 |
|
|
-------------------------------------------------------------------------------
|
16 |
|
|
|
17 |
|
|
package Bit_Utils is
|
18 |
|
|
|
19 |
|
|
---------------------------------------------------------------------
|
20 |
|
|
-- rising, falling clock edge and clock level detection functions: --
|
21 |
|
|
---------------------------------------------------------------------
|
22 |
|
|
function Rising_Edge (signal clock_name : Bit) return Boolean;
|
23 |
|
|
function Falling_Edge (signal clock_name : Bit) return Boolean;
|
24 |
|
|
function High_Level (signal clock_name : Bit) return Boolean;
|
25 |
|
|
function Low_Level (signal clock_name : Bit) return Boolean;
|
26 |
|
|
|
27 |
|
|
--------------------------
|
28 |
|
|
-- conversions routines --
|
29 |
|
|
--------------------------
|
30 |
|
|
|
31 |
|
|
function To_Bit (b: Boolean) return Bit;
|
32 |
|
|
function To_Char (l : Bit) return Character;
|
33 |
|
|
function To_String (v : Bit_Vector) return String;
|
34 |
|
|
|
35 |
|
|
----------------------------------
|
36 |
|
|
-- Boolean reduction functions: --
|
37 |
|
|
----------------------------------
|
38 |
|
|
function And_Bits (v: Bit_Vector) return Bit;
|
39 |
|
|
function Nand_Bits (v: Bit_Vector) return Bit;
|
40 |
|
|
function Or_Bits (v: Bit_Vector) return Bit;
|
41 |
|
|
function Nor_Bits (v: Bit_Vector) return Bit;
|
42 |
|
|
function Xor_Bits (v: Bit_Vector) return Bit;
|
43 |
|
|
function Xnor_Bits (v: Bit_Vector) return Bit;
|
44 |
|
|
|
45 |
|
|
-- preset / clear procedure:
|
46 |
|
|
procedure Preset_Clear (signal FF: out Bit_Vector; Pc_Value: Bit_Vector);
|
47 |
|
|
procedure Preset_Clear (signal FF: out Bit; Pc_Value: Bit);
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
attribute BUILT_IN: BOOLEAN; --D
|
51 |
|
|
attribute BUILT_IN of Rising_Edge: function is TRUE; --D
|
52 |
|
|
attribute BUILT_IN of Falling_Edge: function is TRUE; --D
|
53 |
|
|
attribute BUILT_IN of High_Level: function is TRUE; --D
|
54 |
|
|
attribute BUILT_IN of LOw_Level: function is TRUE; --D
|
55 |
|
|
attribute BUILT_IN of To_Bit : function is TRUE; --D
|
56 |
|
|
attribute BUILT_IN of To_Char : function is TRUE; --D
|
57 |
|
|
attribute BUILT_IN of To_String : function is TRUE; --D
|
58 |
|
|
attribute BUILT_IN of And_Bits: function is TRUE; --D
|
59 |
|
|
attribute BUILT_IN of Nand_Bits: function is TRUE; --D
|
60 |
|
|
attribute BUILT_IN of Or_Bits: function is TRUE; --D
|
61 |
|
|
attribute BUILT_IN of Nor_Bits: function is TRUE; --D
|
62 |
|
|
attribute BUILT_IN of Xor_Bits: function is TRUE; --D
|
63 |
|
|
attribute BUILT_IN of Xnor_Bits: function is TRUE; --D
|
64 |
|
|
attribute BUILT_IN of Preset_Clear: procedure is TRUE; --D
|
65 |
|
|
|
66 |
|
|
end Bit_Utils;
|
67 |
|
|
|