[14] | 1 | /**CHeaderFile***************************************************************** |
---|
| 2 | |
---|
| 3 | FileName [var.h] |
---|
| 4 | |
---|
| 5 | PackageName [var] |
---|
| 6 | |
---|
| 7 | Synopsis [Multi-valued variables.] |
---|
| 8 | |
---|
| 9 | Description [This package contains the data structure for multi-valued |
---|
| 10 | variables. For each variable in a BLIF-MV network, this structure is |
---|
| 11 | created. The information contained in this structure for a variable is |
---|
| 12 | the name, the type (PI,PO,PS,NS etc), the range size, the list of symbolic |
---|
| 13 | value names if any, and the encoding of a variable. Any variable can be |
---|
| 14 | categorized either to an enumerative variable or a symbolic variable. |
---|
| 15 | Enumerative variables are variables which take values from [0,...,n-1\], |
---|
| 16 | where n is the range of the variable, while symbolic variables are |
---|
| 17 | variables which take symbolic values (e.g., [red,blue,green\]). ] |
---|
| 18 | |
---|
| 19 | SeeAlso [] |
---|
| 20 | |
---|
| 21 | Author [Yuji Kukimoto] |
---|
| 22 | |
---|
| 23 | Copyright [Copyright (c) 1994-1996 The Regents of the Univ. of California. |
---|
| 24 | All rights reserved. |
---|
| 25 | |
---|
| 26 | Permission is hereby granted, without written agreement and without license |
---|
| 27 | or royalty fees, to use, copy, modify, and distribute this software and its |
---|
| 28 | documentation for any purpose, provided that the above copyright notice and |
---|
| 29 | the following two paragraphs appear in all copies of this software. |
---|
| 30 | |
---|
| 31 | IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR |
---|
| 32 | DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT |
---|
| 33 | OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF |
---|
| 34 | CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 35 | |
---|
| 36 | THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, |
---|
| 37 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
---|
| 38 | FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN |
---|
| 39 | "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE |
---|
| 40 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.] |
---|
| 41 | |
---|
| 42 | Revision [$Id: var.h,v 1.3 1998/05/19 22:04:27 hsv Exp $] |
---|
| 43 | |
---|
| 44 | ******************************************************************************/ |
---|
| 45 | |
---|
| 46 | #ifndef _VAR |
---|
| 47 | #define _VAR |
---|
| 48 | |
---|
| 49 | /*---------------------------------------------------------------------------*/ |
---|
| 50 | /* Nested includes */ |
---|
| 51 | /*---------------------------------------------------------------------------*/ |
---|
| 52 | |
---|
| 53 | /*---------------------------------------------------------------------------*/ |
---|
| 54 | /* Constant declarations */ |
---|
| 55 | /*---------------------------------------------------------------------------*/ |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | /*---------------------------------------------------------------------------*/ |
---|
| 59 | /* Stucture declarations */ |
---|
| 60 | /*---------------------------------------------------------------------------*/ |
---|
| 61 | |
---|
| 62 | /*---------------------------------------------------------------------------*/ |
---|
| 63 | /* Type declarations */ |
---|
| 64 | /*---------------------------------------------------------------------------*/ |
---|
| 65 | typedef struct VarVariableStruct Var_Variable_t; |
---|
| 66 | |
---|
| 67 | /*---------------------------------------------------------------------------*/ |
---|
| 68 | /* Variable declarations */ |
---|
| 69 | /*---------------------------------------------------------------------------*/ |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | /*---------------------------------------------------------------------------*/ |
---|
| 73 | /* Macro declarations */ |
---|
| 74 | /*---------------------------------------------------------------------------*/ |
---|
| 75 | |
---|
| 76 | #include "hrc.h" |
---|
| 77 | |
---|
| 78 | /**AutomaticStart*************************************************************/ |
---|
| 79 | |
---|
| 80 | /*---------------------------------------------------------------------------*/ |
---|
| 81 | /* Function prototypes */ |
---|
| 82 | /*---------------------------------------------------------------------------*/ |
---|
| 83 | |
---|
| 84 | EXTERN boolean Var_VariableAddRangeInfo(Var_Variable_t * var, int numValues, array_t * symValArray); |
---|
| 85 | EXTERN boolean Var_VariableExpandRange(Var_Variable_t *var, int numValues); |
---|
| 86 | EXTERN boolean Var_VariableReduceRange(Var_Variable_t *var, int numValues); |
---|
| 87 | EXTERN Var_Variable_t * Var_VariableAlloc(Hrc_Node_t *hnode, char *name); |
---|
| 88 | EXTERN void Var_VariableFree(Var_Variable_t *var); |
---|
| 89 | EXTERN Var_Variable_t * Var_VariableDup(Var_Variable_t *var, Hrc_Node_t *hnode); |
---|
| 90 | EXTERN char * Var_VariableReadName(Var_Variable_t *var); |
---|
| 91 | EXTERN boolean Var_VariableTestIsPI(Var_Variable_t *var); |
---|
| 92 | EXTERN boolean Var_VariableTestIsPO(Var_Variable_t *var); |
---|
| 93 | EXTERN boolean Var_VariableTestIsPS(Var_Variable_t *var); |
---|
| 94 | EXTERN boolean Var_VariableTestIsNS(Var_Variable_t *var); |
---|
| 95 | EXTERN boolean Var_VariableTestIsSI(Var_Variable_t *var); |
---|
| 96 | EXTERN boolean Var_VariableTestIsSO(Var_Variable_t *var); |
---|
| 97 | EXTERN boolean Var_VariableTestIsSymbolic(Var_Variable_t *var); |
---|
| 98 | EXTERN boolean Var_VariableTestIsEnumerative(Var_Variable_t *var); |
---|
| 99 | EXTERN boolean Var_VariableTestIsValueInRange(Var_Variable_t *var, int value); |
---|
| 100 | EXTERN int Var_VariableReadNumValues(Var_Variable_t *var); |
---|
| 101 | EXTERN int Var_VariableReadNumFanoutTables(Var_Variable_t *var); |
---|
| 102 | EXTERN void Var_VariableIncrementNumFanoutTables(Var_Variable_t *var); |
---|
| 103 | EXTERN void Var_VariableResetNumFanoutTables(Var_Variable_t* var); |
---|
| 104 | EXTERN char * Var_VariableReadSymbolicValueFromIndex(Var_Variable_t *var, int i); |
---|
| 105 | EXTERN int Var_VariableReadIndexFromSymbolicValue(Var_Variable_t *var, char *symbolicValue); |
---|
| 106 | EXTERN Hrc_Node_t * Var_VariableReadHnode(Var_Variable_t *var); |
---|
| 107 | EXTERN char * Var_VariableReadTypeIdentifier(Var_Variable_t *var); |
---|
| 108 | EXTERN void * Var_VariableReadUndef(Var_Variable_t *var); |
---|
| 109 | EXTERN boolean Var_VariableChangeName(Var_Variable_t *var, char *name); |
---|
| 110 | EXTERN int Var_VariableSetPI(Var_Variable_t *var); |
---|
| 111 | EXTERN int Var_VariableSetPO(Var_Variable_t *var); |
---|
| 112 | EXTERN int Var_VariableSetPS(Var_Variable_t *var); |
---|
| 113 | EXTERN int Var_VariableSetNS(Var_Variable_t *var); |
---|
| 114 | EXTERN int Var_VariableSetSI(Var_Variable_t *var); |
---|
| 115 | EXTERN int Var_VariableSetSO(Var_Variable_t *var); |
---|
| 116 | EXTERN int Var_VariableResetPI(Var_Variable_t *var); |
---|
| 117 | EXTERN int Var_VariableResetPO(Var_Variable_t *var); |
---|
| 118 | EXTERN int Var_VariableResetPS(Var_Variable_t *var); |
---|
| 119 | EXTERN int Var_VariableResetNS(Var_Variable_t *var); |
---|
| 120 | EXTERN int Var_VariableResetSI(Var_Variable_t *var); |
---|
| 121 | EXTERN int Var_VariableResetSO(Var_Variable_t *var); |
---|
| 122 | EXTERN void Var_VariableResetAllTypes(Var_Variable_t *var); |
---|
| 123 | EXTERN void Var_VariableSetTypeIdentifier(Var_Variable_t *var, char *typeIdentifier); |
---|
| 124 | EXTERN boolean Var_VariablesTestIdentical(Var_Variable_t *var1, Var_Variable_t *var2); |
---|
| 125 | EXTERN boolean Var_VariablesTestHaveSameDomain(Var_Variable_t *var1, Var_Variable_t *var2); |
---|
| 126 | EXTERN boolean Var_VariableTestTypeConsistency(Var_Variable_t *var); |
---|
| 127 | EXTERN boolean Var_VariablesTestHaveSameTypeIdentifier(Var_Variable_t *var1, Var_Variable_t *var2); |
---|
| 128 | |
---|
| 129 | /**AutomaticEnd***************************************************************/ |
---|
| 130 | |
---|
| 131 | #endif /* _VAR */ |
---|
| 132 | |
---|
| 133 | |
---|
| 134 | |
---|
| 135 | |
---|
| 136 | |
---|
| 137 | |
---|
| 138 | |
---|
| 139 | |
---|
| 140 | |
---|
| 141 | |
---|
| 142 | |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | |
---|
| 146 | |
---|
| 147 | |
---|
| 148 | |
---|
| 149 | |
---|