abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mioApi.c File Reference
#include "mioInt.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START char * Mio_LibraryReadName (Mio_Library_t *pLib)
 DECLARATIONS ///. More...
 
int Mio_LibraryReadGateNum (Mio_Library_t *pLib)
 
Mio_Gate_tMio_LibraryReadGates (Mio_Library_t *pLib)
 
Mio_Gate_t ** Mio_LibraryReadGateArray (Mio_Library_t *pLib)
 
Mio_Gate_tMio_LibraryReadBuf (Mio_Library_t *pLib)
 
Mio_Gate_tMio_LibraryReadInv (Mio_Library_t *pLib)
 
Mio_Gate_tMio_LibraryReadConst0 (Mio_Library_t *pLib)
 
Mio_Gate_tMio_LibraryReadConst1 (Mio_Library_t *pLib)
 
Mio_Gate_tMio_LibraryReadNand2 (Mio_Library_t *pLib)
 
Mio_Gate_tMio_LibraryReadAnd2 (Mio_Library_t *pLib)
 
float Mio_LibraryReadDelayInvRise (Mio_Library_t *pLib)
 
float Mio_LibraryReadDelayInvFall (Mio_Library_t *pLib)
 
float Mio_LibraryReadDelayInvMax (Mio_Library_t *pLib)
 
float Mio_LibraryReadDelayNand2Rise (Mio_Library_t *pLib)
 
float Mio_LibraryReadDelayNand2Fall (Mio_Library_t *pLib)
 
float Mio_LibraryReadDelayNand2Max (Mio_Library_t *pLib)
 
float Mio_LibraryReadDelayAnd2Max (Mio_Library_t *pLib)
 
float Mio_LibraryReadAreaInv (Mio_Library_t *pLib)
 
float Mio_LibraryReadAreaBuf (Mio_Library_t *pLib)
 
float Mio_LibraryReadAreaNand2 (Mio_Library_t *pLib)
 
int Mio_LibraryReadGateNameMax (Mio_Library_t *pLib)
 
Mio_Gate_tMio_LibraryReadGateByName (Mio_Library_t *pLib, char *pName, char *pOutName)
 
char * Mio_LibraryReadSopByName (Mio_Library_t *pLib, char *pName)
 
char * Mio_GateReadName (Mio_Gate_t *pGate)
 
char * Mio_GateReadOutName (Mio_Gate_t *pGate)
 
double Mio_GateReadArea (Mio_Gate_t *pGate)
 
char * Mio_GateReadForm (Mio_Gate_t *pGate)
 
Mio_Pin_tMio_GateReadPins (Mio_Gate_t *pGate)
 
Mio_Library_tMio_GateReadLib (Mio_Gate_t *pGate)
 
Mio_Gate_tMio_GateReadNext (Mio_Gate_t *pGate)
 
Mio_Gate_tMio_GateReadTwin (Mio_Gate_t *pGate)
 
int Mio_GateReadPinNum (Mio_Gate_t *pGate)
 
double Mio_GateReadDelayMax (Mio_Gate_t *pGate)
 
char * Mio_GateReadSop (Mio_Gate_t *pGate)
 
word Mio_GateReadTruth (Mio_Gate_t *pGate)
 
wordMio_GateReadTruthP (Mio_Gate_t *pGate)
 
int Mio_GateReadValue (Mio_Gate_t *pGate)
 
void Mio_GateSetValue (Mio_Gate_t *pGate, int Value)
 
char * Mio_PinReadName (Mio_Pin_t *pPin)
 
Mio_PinPhase_t Mio_PinReadPhase (Mio_Pin_t *pPin)
 
double Mio_PinReadInputLoad (Mio_Pin_t *pPin)
 
double Mio_PinReadMaxLoad (Mio_Pin_t *pPin)
 
double Mio_PinReadDelayBlockRise (Mio_Pin_t *pPin)
 
double Mio_PinReadDelayFanoutRise (Mio_Pin_t *pPin)
 
double Mio_PinReadDelayBlockFall (Mio_Pin_t *pPin)
 
double Mio_PinReadDelayFanoutFall (Mio_Pin_t *pPin)
 
double Mio_PinReadDelayBlockMax (Mio_Pin_t *pPin)
 
Mio_Pin_tMio_PinReadNext (Mio_Pin_t *pPin)
 
char * Mio_GateReadPinName (Mio_Gate_t *pGate, int iPin)
 
float Mio_GateReadPinDelay (Mio_Gate_t *pGate, int iPin)
 

Function Documentation

double Mio_GateReadArea ( Mio_Gate_t pGate)

Definition at line 145 of file mioApi.c.

145 { return pGate->dArea; }
double dArea
Definition: mioInt.h:83
double Mio_GateReadDelayMax ( Mio_Gate_t pGate)

Definition at line 152 of file mioApi.c.

152 { return pGate->dDelayMax; }
double dDelayMax
Definition: mioInt.h:95
char* Mio_GateReadForm ( Mio_Gate_t pGate)

Definition at line 146 of file mioApi.c.

146 { return pGate->pForm; }
char * pForm
Definition: mioInt.h:84
Mio_Library_t* Mio_GateReadLib ( Mio_Gate_t pGate)

Definition at line 148 of file mioApi.c.

148 { return pGate->pLib; }
Mio_Library_t * pLib
Definition: mioInt.h:88
char* Mio_GateReadName ( Mio_Gate_t pGate)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 143 of file mioApi.c.

143 { return pGate->pName; }
char * pName
Definition: mioInt.h:82
Mio_Gate_t* Mio_GateReadNext ( Mio_Gate_t pGate)

Definition at line 149 of file mioApi.c.

149 { return pGate->pNext; }
Mio_Gate_t * pNext
Definition: mioInt.h:90
char* Mio_GateReadOutName ( Mio_Gate_t pGate)

Definition at line 144 of file mioApi.c.

144 { return pGate->pOutName; }
char * pOutName
Definition: mioInt.h:86
float Mio_GateReadPinDelay ( Mio_Gate_t pGate,
int  iPin 
)

Definition at line 201 of file mioApi.c.

202 {
203  Mio_Pin_t * pPin;
204  int i = 0;
205  Mio_GateForEachPin( pGate, pPin )
206  if ( i++ == iPin )
207  return 0.5 * pPin->dDelayBlockRise + 0.5 * pPin->dDelayBlockFall;
208  return ABC_INFINITY;
209 }
#define Mio_GateForEachPin(Gate, Pin)
Definition: mio.h:76
if(last==0)
Definition: sparse_int.h:34
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
char* Mio_GateReadPinName ( Mio_Gate_t pGate,
int  iPin 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 192 of file mioApi.c.

193 {
194  Mio_Pin_t * pPin;
195  int i = 0;
196  Mio_GateForEachPin( pGate, pPin )
197  if ( i++ == iPin )
198  return Mio_PinReadName(pPin);
199  return NULL;
200 }
#define Mio_GateForEachPin(Gate, Pin)
Definition: mio.h:76
char * Mio_PinReadName(Mio_Pin_t *pPin)
Definition: mioApi.c:170
if(last==0)
Definition: sparse_int.h:34
int Mio_GateReadPinNum ( Mio_Gate_t pGate)

Definition at line 151 of file mioApi.c.

151 { return pGate->nInputs; }
Mio_Pin_t* Mio_GateReadPins ( Mio_Gate_t pGate)

Definition at line 147 of file mioApi.c.

147 { return pGate->pPins; }
Mio_Pin_t * pPins
Definition: mioInt.h:85
char* Mio_GateReadSop ( Mio_Gate_t pGate)

Definition at line 153 of file mioApi.c.

153 { return pGate->pSop; }
char * pSop
Definition: mioInt.h:96
word Mio_GateReadTruth ( Mio_Gate_t pGate)

Definition at line 154 of file mioApi.c.

154 { return pGate->nInputs <= 6 ? pGate->uTruth : 0; }
word* Mio_GateReadTruthP ( Mio_Gate_t pGate)

Definition at line 155 of file mioApi.c.

155 { return pGate->nInputs <= 6 ? NULL: pGate->pTruth; }
word * pTruth
Definition: mioInt.h:99
Mio_Gate_t* Mio_GateReadTwin ( Mio_Gate_t pGate)

Definition at line 150 of file mioApi.c.

150 { return pGate->pTwin; }
Mio_Gate_t * pTwin
Definition: mioInt.h:91
int Mio_GateReadValue ( Mio_Gate_t pGate)

Definition at line 156 of file mioApi.c.

156 { return pGate->Value; }
void Mio_GateSetValue ( Mio_Gate_t pGate,
int  Value 
)

Definition at line 157 of file mioApi.c.

157 { pGate->Value = Value; }
Mio_Gate_t* Mio_LibraryReadAnd2 ( Mio_Library_t pLib)

Definition at line 52 of file mioApi.c.

52 { return pLib->pGateAnd2; }
Mio_Gate_t * pGateAnd2
Definition: mioInt.h:73
float Mio_LibraryReadAreaBuf ( Mio_Library_t pLib)

Definition at line 61 of file mioApi.c.

61 { return (float)(pLib->pGateBuf? pLib->pGateBuf->dArea : 0.0); }
Mio_Gate_t * pGateBuf
Definition: mioInt.h:70
double dArea
Definition: mioInt.h:83
float Mio_LibraryReadAreaInv ( Mio_Library_t pLib)

Definition at line 60 of file mioApi.c.

60 { return (float)(pLib->pGateInv? pLib->pGateInv->dArea : 0.0); }
Mio_Gate_t * pGateInv
Definition: mioInt.h:71
double dArea
Definition: mioInt.h:83
float Mio_LibraryReadAreaNand2 ( Mio_Library_t pLib)

Definition at line 62 of file mioApi.c.

62 { return (float)(pLib->pGateNand2? pLib->pGateNand2->dArea : 0.0); }
Mio_Gate_t * pGateNand2
Definition: mioInt.h:72
double dArea
Definition: mioInt.h:83
Mio_Gate_t* Mio_LibraryReadBuf ( Mio_Library_t pLib)

Definition at line 47 of file mioApi.c.

47 { return pLib->pGateBuf; }
Mio_Gate_t * pGateBuf
Definition: mioInt.h:70
Mio_Gate_t* Mio_LibraryReadConst0 ( Mio_Library_t pLib)

Definition at line 49 of file mioApi.c.

49 { return pLib->pGate0; }
Mio_Gate_t * pGate0
Definition: mioInt.h:68
Mio_Gate_t* Mio_LibraryReadConst1 ( Mio_Library_t pLib)

Definition at line 50 of file mioApi.c.

50 { return pLib->pGate1; }
Mio_Gate_t * pGate1
Definition: mioInt.h:69
float Mio_LibraryReadDelayAnd2Max ( Mio_Library_t pLib)

Definition at line 59 of file mioApi.c.

59 { return (float)(pLib->pGateAnd2? pLib->pGateAnd2->pPins->dDelayBlockMax : 0.0); }
double dDelayBlockMax
Definition: mioInt.h:113
Mio_Pin_t * pPins
Definition: mioInt.h:85
Mio_Gate_t * pGateAnd2
Definition: mioInt.h:73
float Mio_LibraryReadDelayInvFall ( Mio_Library_t pLib)

Definition at line 54 of file mioApi.c.

54 { return (float)(pLib->pGateInv? pLib->pGateInv->pPins->dDelayBlockFall : 0.0); }
Mio_Pin_t * pPins
Definition: mioInt.h:85
Mio_Gate_t * pGateInv
Definition: mioInt.h:71
double dDelayBlockFall
Definition: mioInt.h:111
float Mio_LibraryReadDelayInvMax ( Mio_Library_t pLib)

Definition at line 55 of file mioApi.c.

55 { return (float)(pLib->pGateInv? pLib->pGateInv->pPins->dDelayBlockMax : 0.0); }
double dDelayBlockMax
Definition: mioInt.h:113
Mio_Pin_t * pPins
Definition: mioInt.h:85
Mio_Gate_t * pGateInv
Definition: mioInt.h:71
float Mio_LibraryReadDelayInvRise ( Mio_Library_t pLib)

Definition at line 53 of file mioApi.c.

53 { return (float)(pLib->pGateInv? pLib->pGateInv->pPins->dDelayBlockRise : 0.0); }
Mio_Pin_t * pPins
Definition: mioInt.h:85
Mio_Gate_t * pGateInv
Definition: mioInt.h:71
double dDelayBlockRise
Definition: mioInt.h:109
float Mio_LibraryReadDelayNand2Fall ( Mio_Library_t pLib)

Definition at line 57 of file mioApi.c.

57 { return (float)(pLib->pGateNand2? pLib->pGateNand2->pPins->dDelayBlockFall : 0.0); }
Mio_Pin_t * pPins
Definition: mioInt.h:85
double dDelayBlockFall
Definition: mioInt.h:111
Mio_Gate_t * pGateNand2
Definition: mioInt.h:72
float Mio_LibraryReadDelayNand2Max ( Mio_Library_t pLib)

Definition at line 58 of file mioApi.c.

58 { return (float)(pLib->pGateNand2? pLib->pGateNand2->pPins->dDelayBlockMax : 0.0); }
double dDelayBlockMax
Definition: mioInt.h:113
Mio_Pin_t * pPins
Definition: mioInt.h:85
Mio_Gate_t * pGateNand2
Definition: mioInt.h:72
float Mio_LibraryReadDelayNand2Rise ( Mio_Library_t pLib)

Definition at line 56 of file mioApi.c.

56 { return (float)(pLib->pGateNand2? pLib->pGateNand2->pPins->dDelayBlockRise : 0.0); }
Mio_Pin_t * pPins
Definition: mioInt.h:85
Mio_Gate_t * pGateNand2
Definition: mioInt.h:72
double dDelayBlockRise
Definition: mioInt.h:109
Mio_Gate_t** Mio_LibraryReadGateArray ( Mio_Library_t pLib)

Definition at line 46 of file mioApi.c.

46 { return pLib->ppGatesName;}
Mio_Gate_t ** ppGatesName
Definition: mioInt.h:66
Mio_Gate_t* Mio_LibraryReadGateByName ( Mio_Library_t pLib,
char *  pName,
char *  pOutName 
)

Function*************************************************************

Synopsis [Read Mvc of the gate by name.]

Description []

SideEffects []

SeeAlso []

Definition at line 99 of file mioApi.c.

100 {
101  Mio_Gate_t * pGate;
102  if ( ! st__lookup( pLib->tName2Gate, pName, (char **)&pGate ) )
103  return NULL;
104  if ( pOutName == NULL )
105  return pGate;
106  if ( !strcmp(pGate->pOutName, pOutName) )
107  return pGate;
108  if ( pGate->pTwin && !strcmp(pGate->pTwin->pOutName, pOutName) )
109  return pGate->pTwin;
110  return NULL;
111 }
Mio_Gate_t * pTwin
Definition: mioInt.h:91
char * pOutName
Definition: mioInt.h:86
int strcmp()
int st__lookup(st__table *table, const char *key, char **value)
Definition: st.c:114
st__table * tName2Gate
Definition: mioInt.h:74
int Mio_LibraryReadGateNameMax ( Mio_Library_t pLib)

Function*************************************************************

Synopsis [Returns the longest gate name.]

Description []

SideEffects []

SeeAlso []

Definition at line 75 of file mioApi.c.

76 {
77  Mio_Gate_t * pGate;
78  int LenMax = 0, LenCur;
79  Mio_LibraryForEachGate( pLib, pGate )
80  {
81  LenCur = strlen( Mio_GateReadName(pGate) );
82  if ( LenMax < LenCur )
83  LenMax = LenCur;
84  }
85  return LenMax;
86 }
char * Mio_GateReadName(Mio_Gate_t *pGate)
Definition: mioApi.c:143
int strlen()
#define Mio_LibraryForEachGate(Lib, Gate)
GLOBAL VARIABLES ///.
Definition: mio.h:65
int Mio_LibraryReadGateNum ( Mio_Library_t pLib)

Definition at line 44 of file mioApi.c.

44 { return pLib->nGates; }
Mio_Gate_t* Mio_LibraryReadGates ( Mio_Library_t pLib)

Definition at line 45 of file mioApi.c.

45 { return pLib->pGates; }
Mio_Gate_t * pGates
Definition: mioInt.h:67
Mio_Gate_t* Mio_LibraryReadInv ( Mio_Library_t pLib)

Definition at line 48 of file mioApi.c.

48 { return pLib->pGateInv; }
Mio_Gate_t * pGateInv
Definition: mioInt.h:71
ABC_NAMESPACE_IMPL_START char* Mio_LibraryReadName ( Mio_Library_t pLib)

DECLARATIONS ///.

CFile****************************************************************

FileName [mioApi.c]

PackageName [MVSIS 1.3: Multi-valued logic synthesis system.]

Synopsis [File reading/writing for technology mapping.]

Author [MVSIS Group]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - September 8, 2003.]

Revision [

Id:
mioApi.c,v 1.4 2004/06/28 14:20:25 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 43 of file mioApi.c.

43 { return pLib->pName; }
Mio_Gate_t* Mio_LibraryReadNand2 ( Mio_Library_t pLib)

Definition at line 51 of file mioApi.c.

51 { return pLib->pGateNand2; }
Mio_Gate_t * pGateNand2
Definition: mioInt.h:72
char* Mio_LibraryReadSopByName ( Mio_Library_t pLib,
char *  pName 
)

Function*************************************************************

Synopsis [Read Mvc of the gate by name.]

Description []

SideEffects []

SeeAlso []

Definition at line 124 of file mioApi.c.

125 {
126  Mio_Gate_t * pGate;
127  if ( st__lookup( pLib->tName2Gate, pName, (char **)&pGate ) )
128  return pGate->pSop;
129  return NULL;
130 }
char * pSop
Definition: mioInt.h:96
int st__lookup(st__table *table, const char *key, char **value)
Definition: st.c:114
st__table * tName2Gate
Definition: mioInt.h:74
double Mio_PinReadDelayBlockFall ( Mio_Pin_t pPin)

Definition at line 176 of file mioApi.c.

176 { return pPin->dDelayBlockFall; }
double dDelayBlockFall
Definition: mioInt.h:111
double Mio_PinReadDelayBlockMax ( Mio_Pin_t pPin)

Definition at line 178 of file mioApi.c.

178 { return pPin->dDelayBlockMax; }
double dDelayBlockMax
Definition: mioInt.h:113
double Mio_PinReadDelayBlockRise ( Mio_Pin_t pPin)

Definition at line 174 of file mioApi.c.

174 { return pPin->dDelayBlockRise; }
double dDelayBlockRise
Definition: mioInt.h:109
double Mio_PinReadDelayFanoutFall ( Mio_Pin_t pPin)

Definition at line 177 of file mioApi.c.

177 { return pPin->dDelayFanoutFall;}
double dDelayFanoutFall
Definition: mioInt.h:112
double Mio_PinReadDelayFanoutRise ( Mio_Pin_t pPin)

Definition at line 175 of file mioApi.c.

175 { return pPin->dDelayFanoutRise;}
double dDelayFanoutRise
Definition: mioInt.h:110
double Mio_PinReadInputLoad ( Mio_Pin_t pPin)

Definition at line 172 of file mioApi.c.

172 { return pPin->dLoadInput; }
double dLoadInput
Definition: mioInt.h:107
double Mio_PinReadMaxLoad ( Mio_Pin_t pPin)

Definition at line 173 of file mioApi.c.

173 { return pPin->dLoadMax; }
double dLoadMax
Definition: mioInt.h:108
char* Mio_PinReadName ( Mio_Pin_t pPin)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 170 of file mioApi.c.

170 { return pPin->pName; }
char * pName
Definition: mioInt.h:105
Mio_Pin_t* Mio_PinReadNext ( Mio_Pin_t pPin)

Definition at line 179 of file mioApi.c.

179 { return pPin->pNext; }
Mio_Pin_t * pNext
Definition: mioInt.h:114
Mio_PinPhase_t Mio_PinReadPhase ( Mio_Pin_t pPin)

Definition at line 171 of file mioApi.c.

171 { return pPin->Phase; }
Mio_PinPhase_t Phase
Definition: mioInt.h:106