ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
amap.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Amap_Par_t_
 
struct  Amap_Out_t_
 

Typedefs

typedef typedefABC_NAMESPACE_HEADER_START struct Amap_Lib_t_ Amap_Lib_t
 INCLUDES ///.
 
typedef struct Amap_Par_t_ Amap_Par_t
 
typedef struct Amap_Out_t_ Amap_Out_t
 

Functions

void Amap_ManSetDefaultParams (Amap_Par_t *pPars)
 MACRO DEFINITIONS ///.
 
void Amap_LibFree (Amap_Lib_t *p)
 
void Amap_LibPrintSelectedGates (Amap_Lib_t *p, int fAllGates)
 
Amap_Lib_tAmap_LibReadAndPrepare (char *pFileName, char *pBuffer, int fVerbose, int fVeryVerbose)
 
int Amap_LibertyParse (char *pFileName, int fVerbose)
 
Vec_Str_tAmap_LibertyParseStr (char *pFileName, int fVerbose)
 

Typedef Documentation

◆ Amap_Lib_t

typedef typedefABC_NAMESPACE_HEADER_START struct Amap_Lib_t_ Amap_Lib_t

INCLUDES ///.

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

FileName [amap.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Technology mapper for standard cells.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
amap.h,v 1.00 2005/06/20 00:00:00 alanmi Exp

] PARAMETERS /// BASIC TYPES ///

Definition at line 42 of file amap.h.

◆ Amap_Out_t

typedef struct Amap_Out_t_ Amap_Out_t

Definition at line 58 of file amap.h.

◆ Amap_Par_t

typedef struct Amap_Par_t_ Amap_Par_t

Definition at line 44 of file amap.h.

Function Documentation

◆ Amap_LibertyParse()

int Amap_LibertyParse ( char * pFileName,
int fVerbose )
extern

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

Synopsis [Parses the standard cell library in Liberty format.]

Description [Writes the resulting file in Genlib format.]

SideEffects []

SeeAlso []

Definition at line 1044 of file amapLiberty.c.

1045{
1046 Amap_Tree_t * p;
1047 char * pPos;
1048 abctime clk = Abc_Clock();
1049 int RetValue;
1050 p = Amap_LibertyStart( pFileName );
1051 if ( p == NULL )
1052 return 0;
1053 pPos = p->pContents;
1054 Amap_LibertyWipeOutComments( p->pContents, p->pContents+p->nContents );
1055 if ( Amap_LibertyBuildItem( p, &pPos, p->pContents + p->nContents ) == 0 )
1056 {
1057 if ( fVerbose )
1058 printf( "Parsing finished successfully.\n" );
1059// Amap_LibertyPrintLiberty( p, "temp_.lib" );
1060 Amap_LibertyPrintGenlib( p, Extra_FileNameGenericAppend(pFileName, ".genlib"), fVerbose );
1061 RetValue = 1;
1062 }
1063 else
1064 {
1065 if ( p->pError )
1066 printf( "%s", p->pError );
1067 if ( fVerbose )
1068 printf( "Parsing failed.\n" );
1069 RetValue = 0;
1070 }
1071 if ( fVerbose )
1072 {
1073 printf( "Memory = %7.2f MB. ", 1.0*(p->nContents+p->nItermAlloc*sizeof(Amap_Item_t))/(1<<20) );
1074 ABC_PRT( "Time", Abc_Clock() - clk );
1075 }
1077 return RetValue;
1078}
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_PRT(a, t)
Definition abc_global.h:255
void Amap_LibertyWipeOutComments(char *pBeg, char *pEnd)
void Amap_LibertyStop(Amap_Tree_t *p)
struct Amap_Tree_t_ Amap_Tree_t
Definition amapLiberty.c:59
struct Amap_Item_t_ Amap_Item_t
Definition amapLiberty.c:47
int Amap_LibertyBuildItem(Amap_Tree_t *p, char **ppPos, char *pEnd)
Amap_Tree_t * Amap_LibertyStart(char *pFileName)
int Amap_LibertyPrintGenlib(Amap_Tree_t *p, char *pFileName, int fVerbose)
Cube * p
Definition exorList.c:222
char * Extra_FileNameGenericAppend(char *pBase, char *pSuffix)
Here is the call graph for this function:

◆ Amap_LibertyParseStr()

Vec_Str_t * Amap_LibertyParseStr ( char * pFileName,
int fVerbose )
extern

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

Synopsis [Parses the standard cell library in Liberty format.]

Description [Writes the resulting file in Genlib format.]

SideEffects []

SeeAlso []

Definition at line 1091 of file amapLiberty.c.

1092{
1093 Amap_Tree_t * p;
1094 Vec_Str_t * vStr = NULL;
1095 char * pPos;
1096 abctime clk = Abc_Clock();
1097 int RetValue;
1098 p = Amap_LibertyStart( pFileName );
1099 if ( p == NULL )
1100 return 0;
1101 pPos = p->pContents;
1102 Amap_LibertyWipeOutComments( p->pContents, p->pContents+p->nContents );
1103 if ( Amap_LibertyBuildItem( p, &pPos, p->pContents + p->nContents ) == 0 )
1104 {
1105 if ( fVerbose )
1106 printf( "Parsing finished successfully.\n" );
1107// Amap_LibertyPrintLiberty( p, "temp_.lib" );
1108 vStr = Amap_LibertyPrintGenlibStr( p, fVerbose );
1109 RetValue = 1;
1110 }
1111 else
1112 {
1113 if ( p->pError )
1114 printf( "%s", p->pError );
1115 if ( fVerbose )
1116 printf( "Parsing failed.\n" );
1117 RetValue = 0;
1118 }
1119 if ( fVerbose )
1120 {
1121 printf( "Memory = %7.2f MB. ", 1.0*(p->nContents+p->nItermAlloc*sizeof(Amap_Item_t))/(1<<20) );
1122 ABC_PRT( "Time", Abc_Clock() - clk );
1123 }
1125 return vStr;
1126}
Vec_Str_t * Amap_LibertyPrintGenlibStr(Amap_Tree_t *p, int fVerbose)
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
Here is the call graph for this function:

◆ Amap_LibFree()

void Amap_LibFree ( Amap_Lib_t * p)
extern

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

Synopsis [Deallocs a library.]

Description []

SideEffects []

SeeAlso []

Definition at line 67 of file amapLib.c.

68{
69 if ( p == NULL )
70 return;
71 if ( p->vSelect )
72 Vec_PtrFree( p->vSelect );
73 if ( p->vSorted )
74 Vec_PtrFree( p->vSorted );
75 if ( p->vGates )
76 Vec_PtrFree( p->vGates );
77 if ( p->vRules )
78 Vec_VecFree( (Vec_Vec_t *)p->vRules );
79 if ( p->vRulesX )
80 Vec_VecFree( (Vec_Vec_t *)p->vRulesX );
81 if ( p->vRules3 )
82 Vec_IntFree( p->vRules3 );
83 Aig_MmFlexStop( p->pMemGates, 0 );
84 Aig_MmFlexStop( p->pMemSet, 0 );
85 ABC_FREE( p->pRules );
86 ABC_FREE( p->pRulesX );
87 ABC_FREE( p->pNodes );
88 ABC_FREE( p->pName );
89 ABC_FREE( p );
90}
#define ABC_FREE(obj)
Definition abc_global.h:267
void Aig_MmFlexStop(Aig_MmFlex_t *p, int fVerbose)
Definition aigMem.c:337
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition vecVec.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Amap_LibPrintSelectedGates()

void Amap_LibPrintSelectedGates ( Amap_Lib_t * p,
int fAllGates )
extern

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

Synopsis [Selects gates useful for area-only mapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 305 of file amapLib.c.

306{
307 Vec_Ptr_t * vArray;
308 Amap_Gat_t * pGate;
309 int i;
310 vArray = fAllGates? p->vGates : p->vSelect;
311 Vec_PtrForEachEntry( Amap_Gat_t *, vArray, pGate, i )
312 {
313 printf( "%3d :%12s %d %9.2f ", i, pGate->pName, pGate->nPins, pGate->dArea );
314 printf( "%4s=%40s ", pGate->pOutName, pGate->pForm );
315 printf( "DSD: " );
316 Kit_DsdPrintFromTruth( pGate->pFunc, pGate->nPins );
317 printf( "\n" );
318 }
319}
struct Amap_Gat_t_ Amap_Gat_t
Definition amapInt.h:66
void Kit_DsdPrintFromTruth(unsigned *pTruth, int nVars)
Definition kitDsd.c:491
char * pForm
Definition amapInt.h:158
double dArea
Definition amapInt.h:157
unsigned nPins
Definition amapInt.h:162
char * pOutName
Definition amapInt.h:156
char * pName
Definition amapInt.h:155
unsigned * pFunc
Definition amapInt.h:159
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:

◆ Amap_LibReadAndPrepare()

Amap_Lib_t * Amap_LibReadAndPrepare ( char * pFileName,
char * pBuffer,
int fVerbose,
int fVeryVerbose )
extern

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

Synopsis [Parses equations for the gates.]

Description []

SideEffects []

SeeAlso []

Definition at line 332 of file amapLib.c.

333{
334 Amap_Lib_t * p;
335 abctime clk = Abc_Clock();
336 if ( pBuffer == NULL )
337 p = Amap_LibReadFile( pFileName, fVerbose );
338 else
339 {
340 p = Amap_LibReadBuffer( pBuffer, fVerbose );
341 if ( p )
342 p->pName = Abc_UtilStrsav( pFileName );
343 }
344 if ( fVerbose )
345 printf( "Read %d gates from file \"%s\".\n", Vec_PtrSize(p->vGates), pFileName );
346 if ( p == NULL )
347 return NULL;
348 if ( !Amap_LibParseEquations( p, fVerbose ) )
349 {
350 Amap_LibFree( p );
351 return NULL;
352 }
353 p->vSorted = Amap_LibSortGatesByArea( p );
354 p->vSelect = Amap_LibSelectGates( p, fVerbose );
355 if ( fVerbose )
356 {
357 printf( "Selected %d functionally unique gates. ", Vec_PtrSize(p->vSelect) );
358 ABC_PRT( "Time", Abc_Clock() - clk );
359// Amap_LibPrintSelectedGates( p, 0 );
360 }
361 clk = Abc_Clock();
362 Amap_LibCreateRules( p, fVeryVerbose );
363 if ( fVerbose )
364 {
365 printf( "Created %d rules and %d matches. ", p->nNodes, p->nSets );
366 ABC_PRT( "Time", Abc_Clock() - clk );
367 }
368 return p;
369}
void Amap_LibCreateRules(Amap_Lib_t *p, int fVeryVerbose)
Definition amapRule.c:426
Amap_Lib_t * Amap_LibReadFile(char *pFileName, int fVerbose)
Definition amapRead.c:485
int Amap_LibParseEquations(Amap_Lib_t *p, int fVerbose)
Definition amapParse.c:392
Amap_Lib_t * Amap_LibReadBuffer(char *pBuffer, int fVerbose)
Definition amapRead.c:458
Vec_Ptr_t * Amap_LibSortGatesByArea(Amap_Lib_t *pLib)
Definition amapLib.c:220
void Amap_LibFree(Amap_Lib_t *p)
Definition amapLib.c:67
Vec_Ptr_t * Amap_LibSelectGates(Amap_Lib_t *p, int fVerbose)
Definition amapLib.c:264
typedefABC_NAMESPACE_HEADER_START struct Amap_Lib_t_ Amap_Lib_t
INCLUDES ///.
Definition amap.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Amap_ManSetDefaultParams()

void Amap_ManSetDefaultParams ( Amap_Par_t * p)
extern

MACRO DEFINITIONS ///.

FUNCTION DECLARATIONS ///

MACRO DEFINITIONS ///.

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

FileName [amapCore.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Technology mapper for standard cells.]

Synopsis [Core mapping procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
amapCore.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

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

Synopsis [This procedure sets default parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file amapCore.c.

47{
48 memset( p, 0, sizeof(Amap_Par_t) );
49 p->nIterFlow = 1; // iterations of area flow
50 p->nIterArea = 4; // iteratoins of exact area
51 p->nCutsMax = 500; // the maximum number of cuts at a node
52 p->fUseMuxes = 0; // enables the use of MUXes
53 p->fUseXors = 1; // enables the use of XORs
54 p->fFreeInvs = 0; // assume inverters are free (area = 0)
55 p->fEpsilon = (float)0.001; // used to compare floating point numbers
56 p->fVerbose = 0; // verbosity flag
57}
struct Amap_Par_t_ Amap_Par_t
Definition amap.h:44
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function: