50 int i, gateId, bufferId;
54 printf(
"Cannot find buffer in the current library. Quitting.\n" );
61 p->vGates = Vec_IntStartFull( Abc_NtkObjNumMax(
p) );
66 Vec_IntWriteEntry(
p->vGates, i, gateId );
74 int i, Counter = 0, CounterAll = 0;
78 pCell = Abc_SclObjCell(pObj);
81 Counter += (pObj->
pData == NULL);
86 printf(
"Could not find %d (out of %d) gates in the current library.\n", Counter, CounterAll );
87 Vec_IntFreeP( &
p->vGates );
109 if ( pObj->
pCopy == NULL )
127#define ABC_SCL_MAX_SIZE 64
136 pCell = SC_LibCell( pLib, Vec_IntEntry(vGates, Abc_ObjId(pObj)) );
138 Counters[pCell->
Order]++;
140 TotArea += pCell->
area;
143 printf(
"Total gates = %d. Total area = %.1f\n", nGates, TotArea );
146 if ( Counters[i] == 0 )
148 printf(
"Cell size = %d. ", i );
149 printf(
"Count = %6d ", Counters[i] );
150 printf(
"(%5.1f %%) ", 100.0 * Counters[i] / nGates );
151 printf(
"Area = %12.1f ", Areas[i] );
152 printf(
"(%5.1f %%) ", 100.0 * Areas[i] / TotArea );
161 Vec_IntFreeP( &
p->vGates );
178 SC_Cell * pCell, * pBest = pRepr;
179 float AreaBest = pRepr->
area;
182 if ( AreaBest < pCell->area )
184 AreaBest = pCell->
area;
192 SC_Cell * pCell, * pRepr = NULL, * pBest = NULL;
195 vMinCells = Vec_IntStartFull( Vec_PtrSize(&pLib->
vCells) );
200 Vec_IntWriteEntry( vMinCells, pCell->
Id, pBest->Id );
213 gateId = Vec_IntEntry(
p->vGates, i );
214 assert( gateId >= 0 && gateId < Vec_PtrSize(&pLib->
vCells) );
215 gateId = Vec_IntEntry( vMinCells, gateId );
216 assert( gateId >= 0 && gateId < Vec_PtrSize(&pLib->
vCells) );
217 Vec_IntWriteEntry(
p->vGates, i, gateId );
220 Vec_IntFree( vMinCells );
226 int i, gateId, Counter = 0;
230 gateId = Vec_IntEntry(
p->vGates, i );
231 Counter += ( gateId == Vec_IntEntry(vMinCells, gateId) );
233 Vec_IntFree( vMinCells );
250 char Buffer[1000], * pToken;
251 FILE * pFile = fopen( pFileName,
"rb" );
252 while ( fgets( Buffer, 1000, pFile ) )
254 pToken =
strtok( Buffer,
" \t\r\n" );
255 if ( pToken == NULL )
257 if ( !
strcmp(pToken,
"set_driving_cell") )
264 else if ( !
strcmp(pToken,
"set_load") )
271 else printf(
"Unrecognized token \"%s\".\n", pToken );
293 if ( pBuffer == NULL )
295 printf(
"Cannot find buffer in the current library. Quitting.\n" );
298 vBufs = Vec_IntAlloc( 100 );
302 pObj->
pData = pBuffer;
303 Vec_IntPush( vBufs, i );
#define Abc_NtkForEachBarBuf(pNtk, pNode, i)
struct Abc_Obj_t_ Abc_Obj_t
#define Abc_NtkForEachNodeNotBarBuf(pNtk, pNode, i)
struct Abc_Ntk_t_ Abc_Ntk_t
#define Abc_NtkForEachNodeNotBarBuf1(pNtk, pNode, i)
#define Abc_NtkForEachObjVec(vIds, pNtk, pObj, i)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
ABC_DLL float Abc_FrameReadMaxLoad()
ABC_DLL char * Abc_FrameReadDrivingCell()
ABC_DLL void Abc_FrameSetDrivingCell(char *pName)
ABC_DLL void Abc_FrameSetMaxLoad(float Load)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
struct Mio_LibraryStruct_t_ Mio_Library_t
Mio_Gate_t * Mio_LibraryReadGateByName(Mio_Library_t *pLib, char *pName, char *pOutName)
char * Mio_GateReadName(Mio_Gate_t *pGate)
struct Mio_GateStruct_t_ Mio_Gate_t
Mio_Gate_t * Mio_LibraryReadBuf(Mio_Library_t *pLib)
#define SC_RingForEachCell(pRing, pCell, i)
#define SC_LibForEachCellClass(p, pCell, i)
int Abc_SclCellFind(SC_Lib *p, char *pName)
SC_Cell * Abc_SclFindMaxAreaCell(SC_Cell *pRepr)
Vec_Int_t * Abc_SclExtractBarBufs(Abc_Ntk_t *pNtk)
void Abc_SclManPrintGateSizes(SC_Lib *pLib, Abc_Ntk_t *p, Vec_Int_t *vGates)
void Abc_SclReadTimingConstr(Abc_Frame_t *pAbc, char *pFileName, int fVerbose)
void Abc_SclSclGates2MioGates(SC_Lib *pLib, Abc_Ntk_t *p)
int Abc_SclCountMinSize(SC_Lib *pLib, Abc_Ntk_t *p, int fUseMax)
ABC_NAMESPACE_IMPL_START void Abc_SclMioGates2SclGates(SC_Lib *pLib, Abc_Ntk_t *p)
DECLARATIONS ///.
void Abc_SclInsertBarBufs(Abc_Ntk_t *pNtk, Vec_Int_t *vBufs)
void Abc_SclPrintGateSizes(SC_Lib *pLib, Abc_Ntk_t *p)
Vec_Int_t * Abc_SclFindMinAreas(SC_Lib *pLib, int fUseMax)
void Abc_SclTransferGates(Abc_Ntk_t *pOld, Abc_Ntk_t *pNew)
void Abc_SclMinsizePerform(SC_Lib *pLib, Abc_Ntk_t *p, int fUseMax, int fVerbose)