ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abcFunc.c File Reference
#include "abc.h"
#include "base/main/main.h"
#include "map/mio/mio.h"
Include dependency graph for abcFunc.c:

Go to the source code of this file.

Macros

#define ABC_MAX_CUBES   1000000
 DECLARATIONS ///.
 
#define ABC_MAX_CUBES2   10000
 

Functions

int Abc_NtkSopToBdd (Abc_Ntk_t *pNtk)
 
int Abc_NtkBddToSop (Abc_Ntk_t *pNtk, int fMode, int nCubeLimit, int fCubeSort)
 
void Abc_NodeBddToCnf (Abc_Obj_t *pNode, Mem_Flex_t *pMmMan, Vec_Str_t *vCube, int fAllPrimes, char **ppSop0, char **ppSop1)
 
void Abc_NtkLogicMakeDirectSops (Abc_Ntk_t *pNtk)
 
int Abc_NtkAigToBdd (Abc_Ntk_t *pNtk)
 
int Abc_NtkSopToAig (Abc_Ntk_t *pNtk)
 
Hop_Obj_tAbc_ConvertSopToAigInternal (Hop_Man_t *pMan, char *pSop)
 
void Abc_ConvertAigToGia_rec1 (Gia_Man_t *p, Hop_Obj_t *pObj)
 
void Abc_ConvertAigToGia_rec2 (Hop_Obj_t *pObj)
 
int Abc_ConvertAigToGia (Gia_Man_t *p, Hop_Obj_t *pRoot)
 
Gia_Man_tAbc_NtkAigToGia (Abc_Ntk_t *p, int fGiaSimple)
 
void Abc_ConvertAigToAig_rec (Abc_Ntk_t *pNtkAig, Hop_Obj_t *pObj)
 
Abc_Obj_tAbc_ConvertAigToAig (Abc_Ntk_t *pNtkAig, Abc_Obj_t *pObjOld)
 DECLARATIONS ///.
 
int Abc_NtkMapToSopUsingLibrary (Abc_Ntk_t *pNtk, void *library)
 
int Abc_NtkMapToSop (Abc_Ntk_t *pNtk)
 
int Abc_NtkSopToBlifMv (Abc_Ntk_t *pNtk)
 
int Abc_NtkToSop (Abc_Ntk_t *pNtk, int fMode, int nCubeLimit)
 
int Abc_NtkToBdd (Abc_Ntk_t *pNtk)
 
int Abc_NtkToAig (Abc_Ntk_t *pNtk)
 
void Abc_ObjFaninSort (Abc_Obj_t *pObj)
 
void Abc_NtkFaninSort (Abc_Ntk_t *pNtk)
 

Macro Definition Documentation

◆ ABC_MAX_CUBES

#define ABC_MAX_CUBES   1000000

DECLARATIONS ///.

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

FileName [abcFunc.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Transformations between different functionality representations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 36 of file abcFunc.c.

◆ ABC_MAX_CUBES2

#define ABC_MAX_CUBES2   10000

Definition at line 37 of file abcFunc.c.

Function Documentation

◆ Abc_ConvertAigToAig()

Abc_Obj_t * Abc_ConvertAigToAig ( Abc_Ntk_t * pNtkAig,
Abc_Obj_t * pObjOld )

DECLARATIONS ///.

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

Synopsis [Converts the network from AIG to BDD representation.]

Description []

SideEffects []

SeeAlso []

Definition at line 1157 of file abcFunc.c.

1158{
1159 Hop_Man_t * pHopMan;
1160 Hop_Obj_t * pRoot;
1161 Abc_Obj_t * pFanin;
1162 int i;
1163 // get the local AIG
1164 pHopMan = (Hop_Man_t *)pObjOld->pNtk->pManFunc;
1165 pRoot = (Hop_Obj_t *)pObjOld->pData;
1166 // check the case of a constant
1167 if ( Hop_ObjIsConst1( Hop_Regular(pRoot) ) )
1168 return Abc_ObjNotCond( Abc_AigConst1(pNtkAig), Hop_IsComplement(pRoot) );
1169 // assign the fanin nodes
1170 Abc_ObjForEachFanin( pObjOld, pFanin, i )
1171 {
1172 assert( pFanin->pCopy != NULL );
1173 Hop_ManPi(pHopMan, i)->pData = pFanin->pCopy;
1174 }
1175 // construct the AIG
1176 Abc_ConvertAigToAig_rec( pNtkAig, Hop_Regular(pRoot) );
1177 Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
1178 // return the result
1179 return Abc_ObjNotCond( (Abc_Obj_t *)Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
1180}
void Abc_ConvertAigToAig_rec(Abc_Ntk_t *pNtkAig, Hop_Obj_t *pObj)
Definition abcFunc.c:1134
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition abcAig.c:683
void Hop_ConeUnmark_rec(Hop_Obj_t *pObj)
Definition hopDfs.c:257
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition hop.h:49
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
void * pManFunc
Definition abc.h:191
void * pData
Definition abc.h:145
Abc_Ntk_t * pNtk
Definition abc.h:130
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ConvertAigToAig_rec()

void Abc_ConvertAigToAig_rec ( Abc_Ntk_t * pNtkAig,
Hop_Obj_t * pObj )

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

Synopsis [Construct BDDs and mark AIG nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 1134 of file abcFunc.c.

1135{
1136 assert( !Hop_IsComplement(pObj) );
1137 if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
1138 return;
1139 Abc_ConvertAigToAig_rec( pNtkAig, Hop_ObjFanin0(pObj) );
1140 Abc_ConvertAigToAig_rec( pNtkAig, Hop_ObjFanin1(pObj) );
1141 pObj->pData = Abc_AigAnd( (Abc_Aig_t *)pNtkAig->pManFunc, (Abc_Obj_t *)Hop_ObjChild0Copy(pObj), (Abc_Obj_t *)Hop_ObjChild1Copy(pObj) );
1142 assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
1143 Hop_ObjSetMarkA( pObj );
1144}
struct Abc_Aig_t_ Abc_Aig_t
Definition abc.h:117
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition abcAig.c:700
void * pData
Definition hop.h:68
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ConvertAigToGia()

int Abc_ConvertAigToGia ( Gia_Man_t * p,
Hop_Obj_t * pRoot )

Definition at line 1029 of file abcFunc.c.

1030{
1031 assert( !Hop_IsComplement(pRoot) );
1032 if ( Hop_ObjIsConst1( pRoot ) )
1033 return 1;
1034 Abc_ConvertAigToGia_rec1( p, pRoot );
1035 Abc_ConvertAigToGia_rec2( pRoot );
1036 return pRoot->iData;
1037}
void Abc_ConvertAigToGia_rec2(Hop_Obj_t *pObj)
Definition abcFunc.c:1019
void Abc_ConvertAigToGia_rec1(Gia_Man_t *p, Hop_Obj_t *pObj)
Definition abcFunc.c:1008
Cube * p
Definition exorList.c:222
int iData
Definition hop.h:69
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ConvertAigToGia_rec1()

void Abc_ConvertAigToGia_rec1 ( Gia_Man_t * p,
Hop_Obj_t * pObj )

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

Synopsis [Converts the network from AIG to GIA representation.]

Description []

SideEffects []

SeeAlso []

Definition at line 1008 of file abcFunc.c.

1009{
1010 assert( !Hop_IsComplement(pObj) );
1011 if ( !Hop_ObjIsNode(pObj) || Hop_ObjIsMarkA(pObj) )
1012 return;
1013 Abc_ConvertAigToGia_rec1( p, Hop_ObjFanin0(pObj) );
1014 Abc_ConvertAigToGia_rec1( p, Hop_ObjFanin1(pObj) );
1015 pObj->iData = Gia_ManAppendAnd2( p, Hop_ObjChild0CopyI(pObj), Hop_ObjChild1CopyI(pObj) );
1016 assert( !Hop_ObjIsMarkA(pObj) ); // loop detection
1017 Hop_ObjSetMarkA( pObj );
1018}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ConvertAigToGia_rec2()

void Abc_ConvertAigToGia_rec2 ( Hop_Obj_t * pObj)

Definition at line 1019 of file abcFunc.c.

1020{
1021 assert( !Hop_IsComplement(pObj) );
1022 if ( !Hop_ObjIsNode(pObj) || !Hop_ObjIsMarkA(pObj) )
1023 return;
1024 Abc_ConvertAigToGia_rec2( Hop_ObjFanin0(pObj) );
1025 Abc_ConvertAigToGia_rec2( Hop_ObjFanin1(pObj) );
1026 assert( Hop_ObjIsMarkA(pObj) ); // loop detection
1027 Hop_ObjClearMarkA( pObj );
1028}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ConvertSopToAigInternal()

Hop_Obj_t * Abc_ConvertSopToAigInternal ( Hop_Man_t * pMan,
char * pSop )

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

Synopsis [Strashes one logic node using its SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 934 of file abcFunc.c.

935{
936 Hop_Obj_t * pAnd, * pSum;
937 int i, Value, nFanins;
938 char * pCube;
939 // get the number of variables
940 nFanins = Abc_SopGetVarNum(pSop);
941 if ( Abc_SopIsExorType(pSop) )
942 {
943 pSum = Hop_ManConst0(pMan);
944 for ( i = 0; i < nFanins; i++ )
945 pSum = Hop_Exor( pMan, pSum, Hop_IthVar(pMan,i) );
946 }
947 else
948 {
949 // go through the cubes of the node's SOP
950 pSum = Hop_ManConst0(pMan);
951 Abc_SopForEachCube( pSop, nFanins, pCube )
952 {
953 // create the AND of literals
954 pAnd = Hop_ManConst1(pMan);
955 Abc_CubeForEachVar( pCube, Value, i )
956 {
957 if ( Value == '1' )
958 pAnd = Hop_And( pMan, pAnd, Hop_IthVar(pMan,i) );
959 else if ( Value == '0' )
960 pAnd = Hop_And( pMan, pAnd, Hop_Not(Hop_IthVar(pMan,i)) );
961 }
962 // add to the sum of cubes
963 pSum = Hop_Or( pMan, pSum, pAnd );
964 }
965 }
966 // decide whether to complement the result
967 if ( Abc_SopIsComplement(pSop) )
968 pSum = Hop_Not(pSum);
969 return pSum;
970}
#define Abc_CubeForEachVar(pCube, Value, i)
Definition abc.h:536
#define Abc_SopForEachCube(pSop, nFanins, pCube)
Definition abc.h:538
ABC_DLL int Abc_SopGetVarNum(char *pSop)
Definition abcSop.c:584
ABC_DLL int Abc_SopIsExorType(char *pSop)
Definition abcSop.c:850
ABC_DLL int Abc_SopIsComplement(char *pSop)
Definition abcSop.c:703
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition hopOper.c:63
Hop_Obj_t * Hop_Exor(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
Definition hopOper.c:138
Hop_Obj_t * Hop_And(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
Definition hopOper.c:104
Hop_Obj_t * Hop_Or(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
Definition hopOper.c:171
Here is the call graph for this function:

◆ Abc_NodeBddToCnf()

void Abc_NodeBddToCnf ( Abc_Obj_t * pNode,
Mem_Flex_t * pMmMan,
Vec_Str_t * vCube,
int fAllPrimes,
char ** ppSop0,
char ** ppSop1 )

Definition at line 867 of file abcFunc.c.

867{}
Here is the caller graph for this function:

◆ Abc_NtkAigToBdd()

int Abc_NtkAigToBdd ( Abc_Ntk_t * pNtk)

Definition at line 869 of file abcFunc.c.

869{ return 1; }
Here is the caller graph for this function:

◆ Abc_NtkAigToGia()

Gia_Man_t * Abc_NtkAigToGia ( Abc_Ntk_t * p,
int fGiaSimple )

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

Synopsis [Converts the network from AIG to BDD representation.]

Description []

SideEffects []

SeeAlso []

Definition at line 1050 of file abcFunc.c.

1051{
1052 Gia_Man_t * pNew;
1053 Hop_Man_t * pHopMan;
1054 Hop_Obj_t * pHopObj;
1055 Vec_Int_t * vMapping = NULL;
1056 Vec_Ptr_t * vNodes;
1057 Abc_Obj_t * pNode, * pFanin;
1058 int i, k, nObjs, iGiaObj;
1059 assert( Abc_NtkIsAigLogic(p) );
1060 pHopMan = (Hop_Man_t *)p->pManFunc;
1061 // create new manager
1062 pNew = Gia_ManStart( 10000 );
1063 pNew->pName = Abc_UtilStrsav( Abc_NtkName(p) );
1064 pNew->pSpec = Abc_UtilStrsav( Abc_NtkSpec(p) );
1065 pNew->fGiaSimple = fGiaSimple;
1067 Hop_ManConst1(pHopMan)->iData = 1;
1068 // create primary inputs
1069 Abc_NtkForEachCi( p, pNode, i )
1070 pNode->iTemp = Gia_ManAppendCi(pNew);
1071 // find the number of objects
1072 nObjs = 1 + Abc_NtkCiNum(p) + Abc_NtkCoNum(p);
1073 Abc_NtkForEachNode( p, pNode, i )
1074 nObjs += Abc_ObjIsBarBuf(pNode) ? 1 : Hop_DagSize( (Hop_Obj_t *)pNode->pData );
1075 if ( !fGiaSimple )
1076 vMapping = Vec_IntStart( nObjs );
1077 // iterate through nodes used in the mapping
1078 vNodes = Abc_NtkDfs( p, 0 );
1079 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
1080 {
1081 if ( Abc_ObjIsBarBuf(pNode) )
1082 {
1083 assert( !Abc_ObjFaninC0(pNode) );
1084 pNode->iTemp = Gia_ManAppendBuf( pNew, Abc_ObjFanin0(pNode)->iTemp );
1085 continue;
1086 }
1087 Abc_ObjForEachFanin( pNode, pFanin, k )
1088 Hop_ManPi(pHopMan, k)->iData = pFanin->iTemp;
1089 pHopObj = Hop_Regular( (Hop_Obj_t *)pNode->pData );
1090 if ( Hop_DagSize(pHopObj) > 0 )
1091 {
1092 assert( Abc_ObjFaninNum(pNode) <= Hop_ManPiNum(pHopMan) );
1093 Abc_ConvertAigToGia( pNew, pHopObj );
1094 iGiaObj = Abc_Lit2Var( pHopObj->iData );
1095 if ( vMapping && Gia_ObjIsAnd(Gia_ManObj(pNew, iGiaObj)) && !Vec_IntEntry(vMapping, iGiaObj) )
1096 {
1097 Vec_IntWriteEntry( vMapping, iGiaObj, Vec_IntSize(vMapping) );
1098 Vec_IntPush( vMapping, Abc_ObjFaninNum(pNode) );
1099 Abc_ObjForEachFanin( pNode, pFanin, k )
1100 Vec_IntPush( vMapping, Abc_Lit2Var(pFanin->iTemp) );
1101 Vec_IntPush( vMapping, iGiaObj );
1102 }
1103 }
1104 pNode->iTemp = Abc_LitNotCond( pHopObj->iData, Hop_IsComplement( (Hop_Obj_t *)pNode->pData ) );
1105 }
1106 // create primary outputs
1107 Abc_NtkForEachCo( p, pNode, i )
1108 Gia_ManAppendCo( pNew, Abc_ObjFanin0(pNode)->iTemp );
1109 Gia_ManSetRegNum( pNew, Abc_NtkLatchNum(p) );
1110 // copy original IDs
1111 pNew->vIdsOrig = Vec_IntStart( Gia_ManObjNum(pNew) );
1112 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
1113 Vec_IntWriteEntry( pNew->vIdsOrig, Abc_Lit2Var(pNode->iTemp), Abc_ObjId(pNode) );
1114 Vec_PtrFree( vNodes );
1115 // finish mapping
1116 assert( Gia_ManObjNum(pNew) <= nObjs );
1117 assert( pNew->vMapping == NULL );
1118 pNew->vMapping = vMapping;
1119 return pNew;
1120}
int Abc_ConvertAigToGia(Gia_Man_t *p, Hop_Obj_t *pRoot)
Definition abcFunc.c:1029
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition abcDfs.c:82
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition abc.h:518
ABC_DLL void Abc_NtkCleanCopy(Abc_Ntk_t *pNtk)
Definition abcUtil.c:540
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition abc.h:464
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition giaMan.c:764
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
int Hop_DagSize(Hop_Obj_t *pObj)
Definition hopDfs.c:279
int iTemp
Definition abc.h:149
char * pSpec
Definition gia.h:100
Vec_Int_t * vIdsOrig
Definition gia.h:189
int fGiaSimple
Definition gia.h:116
Vec_Int_t * vMapping
Definition gia.h:136
char * pName
Definition gia.h:99
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:
Here is the caller graph for this function:

◆ Abc_NtkBddToSop()

int Abc_NtkBddToSop ( Abc_Ntk_t * pNtk,
int fMode,
int nCubeLimit,
int fCubeSort )

Definition at line 866 of file abcFunc.c.

866{ return 1; }
Here is the caller graph for this function:

◆ Abc_NtkFaninSort()

void Abc_NtkFaninSort ( Abc_Ntk_t * pNtk)

Definition at line 1386 of file abcFunc.c.

1387{
1388 Abc_Obj_t * pObj; int i;
1389 assert( Abc_NtkIsSopLogic(pNtk) );
1390 Abc_NtkForEachNode( pNtk, pObj, i )
1391 Abc_ObjFaninSort( pObj );
1392}
void Abc_ObjFaninSort(Abc_Obj_t *pObj)
Definition abcFunc.c:1369
Here is the call graph for this function:

◆ Abc_NtkLogicMakeDirectSops()

void Abc_NtkLogicMakeDirectSops ( Abc_Ntk_t * pNtk)

Definition at line 868 of file abcFunc.c.

868{}

◆ Abc_NtkMapToSop()

int Abc_NtkMapToSop ( Abc_Ntk_t * pNtk)

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

Synopsis [Unmaps the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 1228 of file abcFunc.c.

1229{
1230 extern void * Abc_FrameReadLibGen();
1232}
int Abc_NtkMapToSopUsingLibrary(Abc_Ntk_t *pNtk, void *library)
Definition abcFunc.c:1194
ABC_DLL void * Abc_FrameReadLibGen()
Definition mainFrame.c:59
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMapToSopUsingLibrary()

int Abc_NtkMapToSopUsingLibrary ( Abc_Ntk_t * pNtk,
void * library )

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

Synopsis [Unmaps the network with user provided Mio library.]

Description []

SideEffects []

SeeAlso []

Definition at line 1194 of file abcFunc.c.

1195{
1196 Abc_Obj_t * pNode;
1197 char * pSop;
1198 int i;
1199
1200 assert( Abc_NtkHasMapping(pNtk) );
1201 // update the functionality manager
1202 assert( pNtk->pManFunc == (void*) library );
1203 pNtk->pManFunc = Mem_FlexStart();
1204 // update the nodes
1205 Abc_NtkForEachNode( pNtk, pNode, i )
1206 {
1207 if ( Abc_ObjIsBarBuf(pNode) )
1208 continue;
1209 pSop = Mio_GateReadSop((Mio_Gate_t *)pNode->pData);
1210 assert( Abc_SopGetVarNum(pSop) == Abc_ObjFaninNum(pNode) );
1211 pNode->pData = Abc_SopRegister( (Mem_Flex_t *)pNtk->pManFunc, pSop );
1212 }
1213 pNtk->ntkFunc = ABC_FUNC_SOP;
1214 return 1;
1215}
@ ABC_FUNC_SOP
Definition abc.h:65
ABC_DLL char * Abc_SopRegister(Mem_Flex_t *pMan, const char *pName)
DECLARATIONS ///.
Definition abcSop.c:62
Mem_Flex_t * Mem_FlexStart()
Definition mem.c:327
char * Mio_GateReadSop(Mio_Gate_t *pGate)
Definition mioApi.c:179
struct Mio_GateStruct_t_ Mio_Gate_t
Definition mio.h:43
struct Mem_Flex_t_ Mem_Flex_t
Definition mem.h:34
Abc_NtkFunc_t ntkFunc
Definition abc.h:157
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkSopToAig()

int Abc_NtkSopToAig ( Abc_Ntk_t * pNtk)

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

Synopsis [Converts the network from SOP to AIG representation.]

Description []

SideEffects []

SeeAlso []

Definition at line 884 of file abcFunc.c.

885{
886 Abc_Obj_t * pNode;
887 Hop_Man_t * pMan;
888 int i, Max;
889
890 assert( Abc_NtkHasSop(pNtk) );
891
892 // make dist1-free and SCC-free
893// Abc_NtkMakeLegit( pNtk );
894
895 // start the functionality manager
896 pMan = Hop_ManStart();
897 Max = Abc_NtkGetFaninMax(pNtk);
898 if ( Max ) Hop_IthVar( pMan, Max-1 );
899
900 // convert each node from SOP to BDD
901 Abc_NtkForEachNode( pNtk, pNode, i )
902 {
903 if ( Abc_ObjIsBarBuf(pNode) )
904 continue;
905 assert( pNode->pData );
906 pNode->pData = Abc_ConvertSopToAig( pMan, (char *)pNode->pData );
907 if ( pNode->pData == NULL )
908 {
909 Hop_ManStop( pMan );
910 printf( "Abc_NtkSopToAig: Error while converting SOP into AIG.\n" );
911 return 0;
912 }
913 }
914 Mem_FlexStop( (Mem_Flex_t *)pNtk->pManFunc, 0 );
915 pNtk->pManFunc = pMan;
916
917 // update the network type
918 pNtk->ntkFunc = ABC_FUNC_AIG;
919 return 1;
920}
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
Definition abcUtil.c:486
@ ABC_FUNC_AIG
Definition abc.h:67
void Hop_ManStop(Hop_Man_t *p)
Definition hopMan.c:84
Hop_Man_t * Hop_ManStart()
DECLARATIONS ///.
Definition hopMan.c:45
void Mem_FlexStop(Mem_Flex_t *p, int fVerbose)
Definition mem.c:359
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkSopToBdd()

int Abc_NtkSopToBdd ( Abc_Ntk_t * pNtk)

Definition at line 865 of file abcFunc.c.

865{ return 1; }
Here is the caller graph for this function:

◆ Abc_NtkSopToBlifMv()

int Abc_NtkSopToBlifMv ( Abc_Ntk_t * pNtk)

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

Synopsis [Converts SOP functions into BLIF-MV functions.]

Description []

SideEffects []

SeeAlso []

Definition at line 1245 of file abcFunc.c.

1246{
1247 return 1;
1248}

◆ Abc_NtkToAig()

int Abc_NtkToAig ( Abc_Ntk_t * pNtk)

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

Synopsis [Convers logic network to the SOP form.]

Description []

SideEffects []

SeeAlso []

Definition at line 1333 of file abcFunc.c.

1334{
1335 assert( !Abc_NtkIsStrash(pNtk) );
1336 if ( Abc_NtkHasBlackbox(pNtk) )
1337 return 1;
1338 if ( Abc_NtkHasAig(pNtk) )
1339 return 1;
1340 if ( Abc_NtkHasMapping(pNtk) )
1341 {
1342 Abc_NtkMapToSop(pNtk);
1343 return Abc_NtkSopToAig(pNtk);
1344 }
1345 if ( Abc_NtkHasBdd(pNtk) )
1346 {
1347 if ( !Abc_NtkBddToSop(pNtk, -1, ABC_INFINITY, 1) )
1348 return 0;
1349 return Abc_NtkSopToAig(pNtk);
1350 }
1351 if ( Abc_NtkHasSop(pNtk) )
1352 return Abc_NtkSopToAig(pNtk);
1353 assert( 0 );
1354 return 0;
1355}
int Abc_NtkMapToSop(Abc_Ntk_t *pNtk)
Definition abcFunc.c:1228
int Abc_NtkBddToSop(Abc_Ntk_t *pNtk, int fMode, int nCubeLimit, int fCubeSort)
Definition abcFunc.c:866
int Abc_NtkSopToAig(Abc_Ntk_t *pNtk)
Definition abcFunc.c:884
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkToBdd()

int Abc_NtkToBdd ( Abc_Ntk_t * pNtk)

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

Synopsis [Convers logic network to the SOP form.]

Description []

SideEffects []

SeeAlso []

Definition at line 1299 of file abcFunc.c.

1300{
1301 assert( !Abc_NtkIsStrash(pNtk) );
1302 if ( Abc_NtkHasBlackbox(pNtk) )
1303 return 1;
1304 if ( Abc_NtkHasBdd(pNtk) )
1305 return 1;
1306 if ( Abc_NtkHasMapping(pNtk) )
1307 {
1308 Abc_NtkMapToSop(pNtk);
1309 return Abc_NtkSopToBdd(pNtk);
1310 }
1311 if ( Abc_NtkHasSop(pNtk) )
1312 {
1313 Abc_NtkSopToAig(pNtk);
1314 return Abc_NtkAigToBdd(pNtk);
1315 }
1316 if ( Abc_NtkHasAig(pNtk) )
1317 return Abc_NtkAigToBdd(pNtk);
1318 assert( 0 );
1319 return 0;
1320}
int Abc_NtkSopToBdd(Abc_Ntk_t *pNtk)
Definition abcFunc.c:865
int Abc_NtkAigToBdd(Abc_Ntk_t *pNtk)
Definition abcFunc.c:869
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkToSop()

int Abc_NtkToSop ( Abc_Ntk_t * pNtk,
int fMode,
int nCubeLimit )

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

Synopsis [Convers logic network to the SOP form.]

Description []

SideEffects []

SeeAlso []

Definition at line 1261 of file abcFunc.c.

1262{
1263 assert( !Abc_NtkIsStrash(pNtk) );
1264 if ( Abc_NtkHasBlackbox(pNtk) )
1265 return 1;
1266 if ( Abc_NtkHasSop(pNtk) )
1267 {
1268 if ( fMode == -1 )
1269 return 1;
1270 if ( !Abc_NtkSopToBdd(pNtk) )
1271 return 0;
1272 return Abc_NtkBddToSop(pNtk, fMode, nCubeLimit, 1);
1273 }
1274 if ( Abc_NtkHasMapping(pNtk) )
1275 return Abc_NtkMapToSop(pNtk);
1276 if ( Abc_NtkHasBdd(pNtk) )
1277 return Abc_NtkBddToSop(pNtk, fMode, nCubeLimit, 1);
1278 if ( Abc_NtkHasAig(pNtk) )
1279 {
1280 if ( !Abc_NtkAigToBdd(pNtk) )
1281 return 0;
1282 return Abc_NtkBddToSop(pNtk, fMode, nCubeLimit, 1);
1283 }
1284 assert( 0 );
1285 return 0;
1286}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjFaninSort()

void Abc_ObjFaninSort ( Abc_Obj_t * pObj)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1369 of file abcFunc.c.

1370{
1371 Vec_Int_t * vFanins = Abc_ObjFaninVec( pObj );
1372 char * pCube, * pSop = (char*)pObj->pData;
1373 int i, j, nVars = Abc_SopGetVarNum( pSop );
1374 assert( nVars == Vec_IntSize(vFanins) );
1375 for ( i = 0; i < Vec_IntSize(vFanins); i++ )
1376 for ( j = i+1; j < Vec_IntSize(vFanins); j++ )
1377 {
1378 if ( Vec_IntEntry(vFanins, i) < Vec_IntEntry(vFanins, j) )
1379 continue;
1380 ABC_SWAP( int, Vec_IntArray(vFanins)[i], Vec_IntArray(vFanins)[j] );
1381 for ( pCube = pSop; *pCube; pCube += nVars + 3 ) {
1382 ABC_SWAP( char, pCube[i], pCube[j] );
1383 }
1384 }
1385}
#define ABC_SWAP(Type, a, b)
Definition abc_global.h:253
Here is the call graph for this function:
Here is the caller graph for this function: