00001
00019 #ifndef __MIO_H__
00020 #define __MIO_H__
00021
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025
00029
00033
00037
00038 typedef enum { MIO_PHASE_UNKNOWN, MIO_PHASE_INV, MIO_PHASE_NONINV } Mio_PinPhase_t;
00039
00040 typedef struct Mio_LibraryStruct_t_ Mio_Library_t;
00041 typedef struct Mio_GateStruct_t_ Mio_Gate_t;
00042 typedef struct Mio_PinStruct_t_ Mio_Pin_t;
00043
00047
00051
00052 #define Mio_LibraryForEachGate( Lib, Gate ) \
00053 for ( Gate = Mio_LibraryReadGates(Lib); \
00054 Gate; \
00055 Gate = Mio_GateReadNext(Gate) )
00056 #define Mio_LibraryForEachGateSafe( Lib, Gate, Gate2 ) \
00057 for ( Gate = Mio_LibraryReadGates(Lib), \
00058 Gate2 = (Gate? Mio_GateReadNext(Gate): NULL); \
00059 Gate; \
00060 Gate = Gate2, \
00061 Gate2 = (Gate? Mio_GateReadNext(Gate): NULL) )
00062
00063 #define Mio_GateForEachPin( Gate, Pin ) \
00064 for ( Pin = Mio_GateReadPins(Gate); \
00065 Pin; \
00066 Pin = Mio_PinReadNext(Pin) )
00067 #define Mio_GateForEachPinSafe( Gate, Pin, Pin2 ) \
00068 for ( Pin = Mio_GateReadPins(Gate), \
00069 Pin2 = (Pin? Mio_PinReadNext(Pin): NULL); \
00070 Pin; \
00071 Pin = Pin2, \
00072 Pin2 = (Pin? Mio_PinReadNext(Pin): NULL) )
00073
00077
00078
00079 extern char * Mio_LibraryReadName ( Mio_Library_t * pLib );
00080 extern int Mio_LibraryReadGateNum ( Mio_Library_t * pLib );
00081 extern Mio_Gate_t * Mio_LibraryReadGates ( Mio_Library_t * pLib );
00082 extern DdManager * Mio_LibraryReadDd ( Mio_Library_t * pLib );
00083 extern Mio_Gate_t * Mio_LibraryReadGateByName ( Mio_Library_t * pLib, char * pName );
00084 extern char * Mio_LibraryReadSopByName ( Mio_Library_t * pLib, char * pName );
00085 extern Mio_Gate_t * Mio_LibraryReadConst0 ( Mio_Library_t * pLib );
00086 extern Mio_Gate_t * Mio_LibraryReadConst1 ( Mio_Library_t * pLib );
00087 extern Mio_Gate_t * Mio_LibraryReadNand2 ( Mio_Library_t * pLib );
00088 extern Mio_Gate_t * Mio_LibraryReadAnd2 ( Mio_Library_t * pLib );
00089 extern Mio_Gate_t * Mio_LibraryReadBuf ( Mio_Library_t * pLib );
00090 extern Mio_Gate_t * Mio_LibraryReadInv ( Mio_Library_t * pLib );
00091 extern float Mio_LibraryReadDelayInvRise( Mio_Library_t * pLib );
00092 extern float Mio_LibraryReadDelayInvFall( Mio_Library_t * pLib );
00093 extern float Mio_LibraryReadDelayInvMax( Mio_Library_t * pLib );
00094 extern float Mio_LibraryReadDelayNand2Rise( Mio_Library_t * pLib );
00095 extern float Mio_LibraryReadDelayNand2Fall( Mio_Library_t * pLib );
00096 extern float Mio_LibraryReadDelayNand2Max( Mio_Library_t * pLib );
00097 extern float Mio_LibraryReadDelayAnd2Max( Mio_Library_t * pLib );
00098 extern float Mio_LibraryReadAreaInv ( Mio_Library_t * pLib );
00099 extern float Mio_LibraryReadAreaBuf ( Mio_Library_t * pLib );
00100 extern float Mio_LibraryReadAreaNand2 ( Mio_Library_t * pLib );
00101 extern int Mio_LibraryReadGateNameMax( Mio_Library_t * pLib );
00102 extern char * Mio_GateReadName ( Mio_Gate_t * pGate );
00103 extern char * Mio_GateReadOutName ( Mio_Gate_t * pGate );
00104 extern double Mio_GateReadArea ( Mio_Gate_t * pGate );
00105 extern char * Mio_GateReadForm ( Mio_Gate_t * pGate );
00106 extern Mio_Pin_t * Mio_GateReadPins ( Mio_Gate_t * pGate );
00107 extern Mio_Library_t * Mio_GateReadLib ( Mio_Gate_t * pGate );
00108 extern Mio_Gate_t * Mio_GateReadNext ( Mio_Gate_t * pGate );
00109 extern int Mio_GateReadInputs ( Mio_Gate_t * pGate );
00110 extern double Mio_GateReadDelayMax ( Mio_Gate_t * pGate );
00111 extern char * Mio_GateReadSop ( Mio_Gate_t * pGate );
00112 extern DdNode * Mio_GateReadFunc ( Mio_Gate_t * pGate );
00113 extern char * Mio_PinReadName ( Mio_Pin_t * pPin );
00114 extern Mio_PinPhase_t Mio_PinReadPhase ( Mio_Pin_t * pPin );
00115 extern double Mio_PinReadInputLoad ( Mio_Pin_t * pPin );
00116 extern double Mio_PinReadMaxLoad ( Mio_Pin_t * pPin );
00117 extern double Mio_PinReadDelayBlockRise ( Mio_Pin_t * pPin );
00118 extern double Mio_PinReadDelayFanoutRise( Mio_Pin_t * pPin );
00119 extern double Mio_PinReadDelayBlockFall ( Mio_Pin_t * pPin );
00120 extern double Mio_PinReadDelayFanoutFall( Mio_Pin_t * pPin );
00121 extern double Mio_PinReadDelayBlockMax ( Mio_Pin_t * pPin );
00122 extern Mio_Pin_t * Mio_PinReadNext ( Mio_Pin_t * pPin );
00123
00124 extern Mio_Library_t * Mio_LibraryRead( void * pAbc, char * FileName, char * ExcludeFile, int fVerbose );
00125 extern int Mio_LibraryReadExclude( void * pAbc, char * ExcludeFile, st_table * tExcludeGate );
00126
00127 extern int Mio_LibraryParseFormulas( Mio_Library_t * pLib );
00128
00129 extern void Mio_LibraryDelete( Mio_Library_t * pLib );
00130 extern void Mio_GateDelete( Mio_Gate_t * pGate );
00131 extern void Mio_PinDelete( Mio_Pin_t * pPin );
00132 extern Mio_Pin_t * Mio_PinDup( Mio_Pin_t * pPin );
00133 extern void Mio_WriteLibrary( FILE * pFile, Mio_Library_t * pLib, int fPrintSops );
00134 extern Mio_Gate_t ** Mio_CollectRoots( Mio_Library_t * pLib, int nInputs, float tDelay, bool fSkipInv, int * pnGates );
00135 extern void Mio_DeriveTruthTable( Mio_Gate_t * pGate, unsigned uTruthsIn[][2], int nSigns, int nInputs, unsigned uTruthRes[] );
00136 extern void Mio_DeriveGateDelays( Mio_Gate_t * pGate,
00137 float ** ptPinDelays, int nPins, int nInputs, float tDelayZero,
00138 float * ptDelaysRes, float * ptPinDelayMax );
00139 extern Mio_Gate_t * Mio_GateCreatePseudo( int nInputs );
00140
00141 #ifdef __cplusplus
00142 }
00143 #endif
00144
00145 #endif
00146
00150