abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcapis.h File Reference

Go to the source code of this file.

Functions

void Abc_Start ()
 INCLUDES ///. More...
 
void Abc_Stop ()
 
void * Abc_FrameGetGlobalFrame ()
 
int Cmd_CommandExecute (void *pAbc, char *pCommandLine)
 
void Abc_NtkInputMiniAig (void *pAbc, void *pMiniAig)
 
void * Abc_NtkOutputMiniAig (void *pAbc)
 
void Abc_NtkSetCiArrivalTime (void *pAbc, int iCi, float Rise, float Fall)
 
void Abc_NtkSetCoRequiredTime (void *pAbc, int iCo, float Rise, float Fall)
 
int * Abc_NtkOutputMiniMapping (void *pAbc)
 
void Abc_NtkPrintMiniMapping (int *pArray)
 
int Abc_FrameReadProbStatus (void *pAbc)
 
void * Abc_FrameReadCex (void *pAbc)
 

Function Documentation

void* Abc_FrameGetGlobalFrame ( )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 593 of file mainFrame.c.

594 {
595  if ( s_GlobalFrame == 0 )
596  {
597  // start the framework
599  // perform initializations
601  }
602  return s_GlobalFrame;
603 }
static ABC_NAMESPACE_IMPL_START Abc_Frame_t * s_GlobalFrame
DECLARATIONS ///.
Definition: mainFrame.c:35
Abc_Frame_t * Abc_FrameAllocate()
Definition: mainFrame.c:137
void Abc_FrameInit(Abc_Frame_t *pAbc)
FUNCTION DEFINITIONS ///.
Definition: mainInit.c:94
void* Abc_FrameReadCex ( void *  pAbc)
int Abc_FrameReadProbStatus ( void *  pAbc)
void Abc_NtkInputMiniAig ( void *  pAbc,
void *  pMiniAig 
)
void* Abc_NtkOutputMiniAig ( void *  pAbc)
int* Abc_NtkOutputMiniMapping ( void *  pAbc0)

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

Synopsis [This procedure outputs an array representing mini-mapped network.]

Description []

SideEffects []

SeeAlso []

Definition at line 875 of file abcMap.c.

876 {
877  Abc_Frame_t * pAbc = (Abc_Frame_t *)pAbc0;
878  Abc_Ntk_t * pNtk;
879  Vec_Int_t * vMapping;
880  int * pArray;
881  if ( pAbc == NULL )
882  printf( "ABC framework is not initialized by calling Abc_Start()\n" );
883  pNtk = Abc_FrameReadNtk( pAbc );
884  if ( pNtk == NULL )
885  printf( "Current network in ABC framework is not defined.\n" );
886  if ( !Abc_NtkHasMapping(pNtk) )
887  printf( "Current network in ABC framework is not mapped.\n" );
888  // derive mini-mapping
889  vMapping = Abc_NtkWriteMiniMapping( pNtk );
890  pArray = Vec_IntArray( vMapping );
891  ABC_FREE( vMapping );
892  // print mini-mapping (optional)
893 // Abc_NtkPrintMiniMapping( pArray );
894  // return the array representation of mini-mapping
895  return pArray;
896 }
static int * Vec_IntArray(Vec_Int_t *p)
Definition: vecInt.h:328
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Abc_NtkHasMapping(Abc_Ntk_t *pNtk)
Definition: abc.h:256
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
#define ABC_FREE(obj)
Definition: abc_global.h:232
Vec_Int_t * Abc_NtkWriteMiniMapping(Abc_Ntk_t *pNtk)
Definition: abcMap.c:770
void Abc_NtkPrintMiniMapping ( int *  pArray)

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

Synopsis [Prints mapped network represented in mini-mapped format.]

Description []

SideEffects []

SeeAlso []

Definition at line 834 of file abcMap.c.

835 {
836  int nCis, nCos, nNodes, nFlops;
837  int i, k, nLeaves, Pos = 4;
838  char * pBuffer, * pName;
839  nCis = pArray[0];
840  nCos = pArray[1];
841  nNodes = pArray[2];
842  nFlops = pArray[3];
843  printf( "Mapped network has %d CIs, %d COs, %d gates, and %d flops.\n", nCis, nCos, nNodes, nFlops );
844  printf( "The first %d object IDs (from 0 to %d) are reserved for the CIs.\n", nCis, nCis - 1 );
845  for ( i = 0; i < nNodes; i++ )
846  {
847  printf( "Node %d has fanins {", nCis + i );
848  nLeaves = pArray[Pos++];
849  for ( k = 0; k < nLeaves; k++ )
850  printf( " %d", pArray[Pos++] );
851  printf( " }\n" );
852  }
853  for ( i = 0; i < nCos; i++ )
854  printf( "CO %d is driven by node %d\n", i, pArray[Pos++] );
855  pBuffer = (char *)(pArray + Pos);
856  for ( i = 0; i < nNodes; i++ )
857  {
858  pName = pBuffer;
859  pBuffer += strlen(pName) + 1;
860  printf( "Node %d has gate \"%s\"\n", nCis + i, pName );
861  }
862 }
ush Pos
Definition: deflate.h:88
int strlen()
void Abc_NtkSetCiArrivalTime ( void *  pAbc0,
int  iCi,
float  Rise,
float  Fall 
)

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

Synopsis [These APIs set arriva/required times of CIs/COs.]

Description []

SideEffects []

SeeAlso []

Definition at line 929 of file abcMap.c.

930 {
931  Abc_Frame_t * pAbc = (Abc_Frame_t *)pAbc0;
932  Abc_Ntk_t * pNtk;
933  Abc_Obj_t * pNode;
934  if ( pAbc == NULL )
935  printf( "ABC framework is not initialized by calling Abc_Start()\n" );
936  pNtk = Abc_FrameReadNtk( pAbc );
937  if ( pNtk == NULL )
938  printf( "Current network in ABC framework is not defined.\n" );
939  if ( iCi < 0 || iCi >= Abc_NtkCiNum(pNtk) )
940  printf( "CI index is not valid.\n" );
941  pNode = Abc_NtkCi( pNtk, iCi );
942  Abc_NtkTimeSetArrival( pNtk, Abc_ObjId(pNode), Rise, Fall );
943 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
ABC_DLL void Abc_NtkTimeSetArrival(Abc_Ntk_t *pNtk, int ObjId, float Rise, float Fall)
Definition: abcTiming.c:185
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:287
static Abc_Obj_t * Abc_NtkCi(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:317
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
void Abc_NtkSetCoRequiredTime ( void *  pAbc,
int  iCo,
float  Rise,
float  Fall 
)

Definition at line 944 of file abcMap.c.

945 {
946  Abc_Frame_t * pAbc = (Abc_Frame_t *)pAbc0;
947  Abc_Ntk_t * pNtk;
948  Abc_Obj_t * pNode;
949  if ( pAbc == NULL )
950  printf( "ABC framework is not initialized by calling Abc_Start()\n" );
951  pNtk = Abc_FrameReadNtk( pAbc );
952  if ( pNtk == NULL )
953  printf( "Current network in ABC framework is not defined.\n" );
954  if ( iCo < 0 || iCo >= Abc_NtkCoNum(pNtk) )
955  printf( "CO index is not valid.\n" );
956  pNode = Abc_NtkCo( pNtk, iCo );
957  Abc_NtkTimeSetRequired( pNtk, Abc_ObjId(pNode), Rise, Fall );
958 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
static Abc_Obj_t * Abc_NtkCo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:318
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
Definition: mainFrame.c:282
ABC_DLL void Abc_NtkTimeSetRequired(Abc_Ntk_t *pNtk, int ObjId, float Rise, float Fall)
Definition: abcTiming.c:200
void Abc_Start ( )

INCLUDES ///.

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

FileName [abcapis.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Include this file in the external code calling ABC.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - September 29, 2012.]

Revision [

Id:
abcapis.h,v 1.00 2012/09/29 00:00:00 alanmi Exp

]PARAMETERS ///BASIC TYPES ///MACRO DEFINITIONS ///FUNCTION DECLARATIONS ///

INCLUDES ///.

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

FileName [main.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [The main package.]

Synopsis [Here everything starts.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Initialization procedure for the library project.]

Description [Note that when Abc_Start() is run in a static library project, it does not load the resource file by default. As a result, ABC is not set up the same way, as when it is run on a command line. For example, some error messages while parsing files will not be produced, and intermediate networks will not be checked for consistancy. One possibility is to load the resource file after Abc_Start() as follows: Abc_UtilsSource( Abc_FrameGetGlobalFrame() );]

SideEffects []

SeeAlso []

Definition at line 52 of file mainLib.c.

53 {
54  Abc_Frame_t * pAbc;
55  // added to detect memory leaks:
56 #if defined(_DEBUG) && defined(_MSC_VER)
57  _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
58 #endif
59  // start the glocal frame
60  pAbc = Abc_FrameGetGlobalFrame();
61  // source the resource file
62 // Abc_UtilsSource( pAbc );
63 }
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
void * Abc_FrameGetGlobalFrame()
Definition: mainFrame.c:593
void Abc_Stop ( )

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

Synopsis [Deallocation procedure for the library project.]

Description []

SideEffects []

SeeAlso []

Definition at line 76 of file mainLib.c.

77 {
78  Abc_Frame_t * pAbc;
79  pAbc = Abc_FrameGetGlobalFrame();
80  // perform uninitializations
81  Abc_FrameEnd( pAbc );
82  // stop the framework
83  Abc_FrameDeallocate( pAbc );
84 }
void Abc_FrameDeallocate(Abc_Frame_t *p)
Definition: mainFrame.c:179
void Abc_FrameEnd(Abc_Frame_t *pAbc)
Definition: mainInit.c:128
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
void * Abc_FrameGetGlobalFrame()
Definition: mainFrame.c:593
int Cmd_CommandExecute ( void *  pAbc,
char *  pCommandLine 
)