[14] | 1 | /**CHeaderFile***************************************************************** |
---|
| 2 | |
---|
| 3 | FileName [simInt.h] |
---|
| 4 | |
---|
| 5 | PackageName [sim] |
---|
| 6 | |
---|
| 7 | Synopsis [sim package internal declarations file.] |
---|
| 8 | |
---|
| 9 | Author [Shaker Sarwary and Tom Shiple] |
---|
| 10 | |
---|
| 11 | Copyright [Copyright (c) 1994-1996 The Regents of the Univ. of California. |
---|
| 12 | All rights reserved. |
---|
| 13 | |
---|
| 14 | Permission is hereby granted, without written agreement and without license |
---|
| 15 | or royalty fees, to use, copy, modify, and distribute this software and its |
---|
| 16 | documentation for any purpose, provided that the above copyright notice and |
---|
| 17 | the following two paragraphs appear in all copies of this software. |
---|
| 18 | |
---|
| 19 | IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR |
---|
| 20 | DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT |
---|
| 21 | OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF |
---|
| 22 | CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 23 | |
---|
| 24 | THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, |
---|
| 25 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
---|
| 26 | FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN |
---|
| 27 | "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE |
---|
| 28 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.] |
---|
| 29 | |
---|
| 30 | Revision [$Id: simInt.h,v 1.4 2005/05/10 15:50:43 hhkim Exp $] |
---|
| 31 | |
---|
| 32 | ******************************************************************************/ |
---|
| 33 | |
---|
| 34 | #ifndef _SIMINT |
---|
| 35 | #define _SIMINT |
---|
| 36 | |
---|
| 37 | /*---------------------------------------------------------------------------*/ |
---|
| 38 | /* Nested includes */ |
---|
| 39 | /*---------------------------------------------------------------------------*/ |
---|
| 40 | #include "cmd.h" |
---|
| 41 | #include "ntm.h" |
---|
| 42 | #include "ord.h" |
---|
| 43 | #include "part.h" |
---|
| 44 | #include "sim.h" |
---|
| 45 | #include <string.h> |
---|
| 46 | |
---|
| 47 | /*---------------------------------------------------------------------------*/ |
---|
| 48 | /* Constant declarations */ |
---|
| 49 | /*---------------------------------------------------------------------------*/ |
---|
| 50 | #define SIMPACKET_SIZE 1000 |
---|
| 51 | |
---|
| 52 | /*---------------------------------------------------------------------------*/ |
---|
| 53 | /* Structure declarations */ |
---|
| 54 | /*---------------------------------------------------------------------------*/ |
---|
| 55 | |
---|
| 56 | /**Struct********************************************************************** |
---|
| 57 | |
---|
| 58 | Synopsis [SIM main structure.] |
---|
| 59 | |
---|
| 60 | ******************************************************************************/ |
---|
| 61 | |
---|
| 62 | struct SimSimStruct { |
---|
| 63 | Ntk_Network_t *network; /* Pointer to the network */ |
---|
| 64 | st_table *nodeToMvfTable; /* MDDs of functions to be simulated */ |
---|
| 65 | char *inputFile; /* simulation file name */ |
---|
| 66 | int lineNumber; /* Current line parsed in InputFile */ |
---|
| 67 | array_t *nodesArray; /* Ordered nodes corresponding to the inputs, |
---|
| 68 | current-states, next-states and outputs */ |
---|
| 69 | int currentStateHead; /* Position of the first currentState in nodesArray */ |
---|
| 70 | int internalPartitionHead; /* Position of the first internal partition node |
---|
| 71 | in nodesArray */ |
---|
| 72 | int nextStateHead; /* Position of the first nextState in nodesArray */ |
---|
| 73 | int outputHead; /* Position of the first output in nodesArray */ |
---|
| 74 | array_t *initState; /* Initial state */ |
---|
| 75 | array_t *vectorArray; /* Array of array representing the |
---|
| 76 | simulation vectors according to the |
---|
| 77 | nodesArray order */ |
---|
| 78 | boolean verbose; |
---|
| 79 | }; |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | /*---------------------------------------------------------------------------*/ |
---|
| 83 | /* Type declarations */ |
---|
| 84 | /*---------------------------------------------------------------------------*/ |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | /*---------------------------------------------------------------------------*/ |
---|
| 88 | /* Variable declarations */ |
---|
| 89 | /*---------------------------------------------------------------------------*/ |
---|
| 90 | |
---|
| 91 | |
---|
| 92 | /*---------------------------------------------------------------------------*/ |
---|
| 93 | /* Macro declarations */ |
---|
| 94 | /*---------------------------------------------------------------------------*/ |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | /**AutomaticStart*************************************************************/ |
---|
| 98 | |
---|
| 99 | /*---------------------------------------------------------------------------*/ |
---|
| 100 | /* Function prototypes */ |
---|
| 101 | /*---------------------------------------------------------------------------*/ |
---|
| 102 | |
---|
| 103 | EXTERN void SimSimInitializeCurrentState(Sim_Sim_t * sim); |
---|
| 104 | EXTERN boolean SimRandomSimulateAndPrint(Ntk_Network_t * network, int num, char * outputFile, Sim_PseudoSrc pseudoInputSource, int printInputsFlag, int printOutputsFlag, int printPseudoInputsFlag, int printStatesFlag, boolean verbose); |
---|
| 105 | EXTERN boolean SimFileSimulateAndPrint(Ntk_Network_t * network, int num, char * inputFile, char * outputFile, Sim_PseudoSrc pseudoInputSource, int printInputsFlag, int printOutputsFlag, int printPseudoInputsFlag, int printStatesFlag, boolean verbose); |
---|
| 106 | EXTERN int SimNodeReadValueCode(Ntk_Node_t * node, char * value); |
---|
| 107 | EXTERN boolean SimTestPartInTermsOfCI(Sim_Sim_t *sim); |
---|
| 108 | EXTERN char * SimInteger2ASCII(int number); |
---|
| 109 | EXTERN void SimStringPrint(FILE * fp, char * string, int len); |
---|
| 110 | EXTERN array_t * SimSimInitDataFormat(Sim_Sim_t * sim); |
---|
| 111 | EXTERN void SimSimVectorFillCurrentState(Sim_Sim_t * sim, int n); |
---|
| 112 | EXTERN int SimNodeComputeRandomValue(Ntk_Node_t * node, Sim_PseudoSrc pseudoInputSource); |
---|
| 113 | EXTERN mdd_t * SimSimVectorBuildMdd(Sim_Sim_t * sim, array_t * vector, array_t * partitionVector); |
---|
| 114 | EXTERN void SimAppendErrorMsg(char * str1, char * str2, char * str3); |
---|
| 115 | EXTERN int SimComputeRandomInteger(void); |
---|
| 116 | EXTERN void SimNodesArrayBuildRootsAndLeaves(Ntk_Network_t *network, array_t * nodesArray, int internalPartitionHead, int nextStateHead, array_t ** roots, array_t ** leaves); |
---|
| 117 | EXTERN st_table * SimNodesArrayBuildNodeToMvfTable(array_t * nodesArray, int internalPartitionHead, array_t * mvfArray); |
---|
| 118 | |
---|
| 119 | /**AutomaticEnd***************************************************************/ |
---|
| 120 | |
---|
| 121 | #endif /* _SIMINT */ |
---|
| 122 | |
---|
| 123 | |
---|
| 124 | |
---|
| 125 | |
---|
| 126 | |
---|
| 127 | |
---|
| 128 | |
---|
| 129 | |
---|
| 130 | |
---|
| 131 | |
---|
| 132 | |
---|
| 133 | |
---|
| 134 | |
---|
| 135 | |
---|
| 136 | |
---|
| 137 | |
---|
| 138 | |
---|
| 139 | |
---|
| 140 | |
---|
| 141 | |
---|
| 142 | |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | |
---|
| 146 | |
---|
| 147 | |
---|
| 148 | |
---|
| 149 | |
---|
| 150 | |
---|
| 151 | |
---|
| 152 | |
---|
| 153 | |
---|
| 154 | |
---|
| 155 | |
---|
| 156 | |
---|
| 157 | |
---|
| 158 | |
---|
| 159 | |
---|
| 160 | |
---|
| 161 | |
---|
| 162 | |
---|
| 163 | |
---|
| 164 | |
---|
| 165 | |
---|
| 166 | |
---|
| 167 | |
---|
| 168 | |
---|
| 169 | |
---|
| 170 | |
---|
| 171 | |
---|
| 172 | |
---|
| 173 | |
---|
| 174 | |
---|
| 175 | |
---|
| 176 | |
---|
| 177 | |
---|
| 178 | |
---|
| 179 | |
---|
| 180 | |
---|
| 181 | |
---|
| 182 | |
---|
| 183 | |
---|
| 184 | |
---|
| 185 | |
---|
| 186 | |
---|
| 187 | |
---|
| 188 | |
---|
| 189 | |
---|
| 190 | |
---|
| 191 | |
---|
| 192 | |
---|
| 193 | |
---|
| 194 | |
---|
| 195 | |
---|
| 196 | |
---|
| 197 | |
---|
| 198 | |
---|
| 199 | |
---|
| 200 | |
---|
| 201 | |
---|
| 202 | |
---|
| 203 | |
---|
| 204 | |
---|
| 205 | |
---|
| 206 | |
---|
| 207 | |
---|
| 208 | |
---|
| 209 | |
---|
| 210 | |
---|
| 211 | |
---|
| 212 | |
---|
| 213 | |
---|
| 214 | |
---|
| 215 | |
---|