ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
acec2Mult.c File Reference
#include "acecInt.h"
#include "misc/vec/vecMem.h"
#include "misc/util/utilTruth.h"
Include dependency graph for acec2Mult.c:

Go to the source code of this file.

Classes

struct  Sdb_Cut_t_
 
struct  Sdb_Sto_t_
 

Macros

#define SDB_MAX_CUTSIZE   6
 DECLARATIONS ///.
 
#define SDB_MAX_CUTNUM   51
 
#define SDB_MAX_TT_WORDS   ((SDB_MAX_CUTSIZE > 6) ? 1 << (SDB_MAX_CUTSIZE-6) : 1)
 
#define SDB_CUT_NO_LEAF   0xF
 
#define Sdb_ForEachCut(pList, pCut, i)
 

Typedefs

typedef struct Sdb_Cut_t_ Sdb_Cut_t
 
typedef struct Sdb_Sto_t_ Sdb_Sto_t
 

Functions

void Sdb_StoMergeCuts (Sdb_Sto_t *p, int iObj)
 
int Sdb_StoDiffExactlyOne (Vec_Wec_t *vCuts, int Limit, int *pCut)
 
int Sdb_StoDiffExactlyOne3 (Vec_Wec_t *vCuts, int Limit, int *pCut, int *pCount)
 
Vec_Int_tSdb_StoFindAll (Vec_Wec_t *vCuts)
 
int Sdb_StoDiffExactlyOne2 (Vec_Int_t *vAll, int *pCut)
 
Vec_Int_tSdb_StoFindInputs (Vec_Wec_t *vCuts, int Front)
 
int Sdb_StoIterCutsOne (Sdb_Sto_t *p, int iObj, int CutSize, int **ppCut)
 
Vec_Int_tSdb_StoIterCuts (Sdb_Sto_t *p)
 
Sdb_Sto_tSdb_StoAlloc (Gia_Man_t *pGia, int nCutSize, int nCutNum, int fCutMin, int fTruthMin, int fVerbose)
 
void Sdb_StoFree (Sdb_Sto_t *p)
 
void Sdb_StoComputeCutsConst0 (Sdb_Sto_t *p, int iObj)
 
void Sdb_StoComputeCutsCi (Sdb_Sto_t *p, int iObj)
 
void Sdb_StoComputeCutsNode (Sdb_Sto_t *p, int iObj)
 
void Sdb_StoRefObj (Sdb_Sto_t *p, int iObj)
 
Vec_Int_tSdb_StoComputeCutsDetect (Gia_Man_t *pGia)
 
void Sdb_StoComputeCutsTest (Gia_Man_t *pGia)
 

Macro Definition Documentation

◆ SDB_CUT_NO_LEAF

#define SDB_CUT_NO_LEAF   0xF

Definition at line 279 of file acec2Mult.c.

◆ Sdb_ForEachCut

#define Sdb_ForEachCut ( pList,
pCut,
i )
Value:
for ( i = 0, pCut = pList + 1; i < pList[0]; i++, pCut += pCut[0] + 2 )

Definition at line 317 of file acec2Mult.c.

◆ SDB_MAX_CUTNUM

#define SDB_MAX_CUTNUM   51

Definition at line 276 of file acec2Mult.c.

◆ SDB_MAX_CUTSIZE

#define SDB_MAX_CUTSIZE   6

DECLARATIONS ///.

Definition at line 275 of file acec2Mult.c.

◆ SDB_MAX_TT_WORDS

#define SDB_MAX_TT_WORDS   ((SDB_MAX_CUTSIZE > 6) ? 1 << (SDB_MAX_CUTSIZE-6) : 1)

Definition at line 277 of file acec2Mult.c.

Typedef Documentation

◆ Sdb_Cut_t

typedef struct Sdb_Cut_t_ Sdb_Cut_t

Definition at line 281 of file acec2Mult.c.

◆ Sdb_Sto_t

typedef struct Sdb_Sto_t_ Sdb_Sto_t

Definition at line 293 of file acec2Mult.c.

Function Documentation

◆ Sdb_StoAlloc()

Sdb_Sto_t * Sdb_StoAlloc ( Gia_Man_t * pGia,
int nCutSize,
int nCutNum,
int fCutMin,
int fTruthMin,
int fVerbose )

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

Synopsis [Incremental cut computation.]

Description []

SideEffects []

SeeAlso []

Definition at line 1114 of file acec2Mult.c.

1115{
1116 Sdb_Sto_t * p;
1117 assert( nCutSize < SDB_CUT_NO_LEAF );
1118 assert( nCutSize > 1 && nCutSize <= SDB_MAX_CUTSIZE );
1119 assert( nCutNum > 1 && nCutNum < SDB_MAX_CUTNUM );
1120 p = ABC_CALLOC( Sdb_Sto_t, 1 );
1121 p->clkStart = Abc_Clock();
1122 p->nCutSize = nCutSize;
1123 p->nCutNum = nCutNum;
1124 p->fCutMin = fCutMin;
1125 p->fTruthMin = fTruthMin;
1126 p->fVerbose = fVerbose;
1127 p->pGia = pGia;
1128 p->vRefs = Vec_IntAlloc( Gia_ManObjNum(pGia) );
1129 p->vCuts = Vec_WecStart( Gia_ManObjNum(pGia) );
1130 p->vTtMem = fCutMin ? Vec_MemAllocForTT( nCutSize, 0 ) : NULL;
1131 return p;
1132}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
#define SDB_CUT_NO_LEAF
Definition acec2Mult.c:279
#define SDB_MAX_CUTSIZE
DECLARATIONS ///.
Definition acec2Mult.c:275
#define SDB_MAX_CUTNUM
Definition acec2Mult.c:276
struct Sdb_Sto_t_ Sdb_Sto_t
Definition acec2Mult.c:293
Cube * p
Definition exorList.c:222
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ Sdb_StoComputeCutsCi()

void Sdb_StoComputeCutsCi ( Sdb_Sto_t * p,
int iObj )

Definition at line 1147 of file acec2Mult.c.

1148{
1149 Sdb_CutAddUnit( p, iObj );
1150}
Here is the caller graph for this function:

◆ Sdb_StoComputeCutsConst0()

void Sdb_StoComputeCutsConst0 ( Sdb_Sto_t * p,
int iObj )

Definition at line 1143 of file acec2Mult.c.

1144{
1145 Sdb_CutAddZero( p, iObj );
1146}
Here is the caller graph for this function:

◆ Sdb_StoComputeCutsDetect()

Vec_Int_t * Sdb_StoComputeCutsDetect ( Gia_Man_t * pGia)

Definition at line 1168 of file acec2Mult.c.

1169{
1170 Vec_Int_t * vRes = NULL;
1171 Sdb_Sto_t * p = Sdb_StoAlloc( pGia, 5, 20, 1, 0, 1 );
1172 Gia_Obj_t * pObj;
1173 int i, iObj;
1174 // prepare references
1175 Gia_ManForEachObj( p->pGia, pObj, iObj )
1176 Sdb_StoRefObj( p, iObj );
1177 // compute cuts
1179 Gia_ManForEachCiId( p->pGia, iObj, i )
1180 Sdb_StoComputeCutsCi( p, iObj );
1181 Gia_ManForEachAnd( p->pGia, pObj, iObj )
1182 Sdb_StoComputeCutsNode( p, iObj );
1183 if ( p->fVerbose )
1184 {
1185 printf( "Running cut computation with CutSize = %d CutNum = %d:\n", p->nCutSize, p->nCutNum );
1186 printf( "CutPair = %.0f ", p->CutCount[0] );
1187 printf( "Merge = %.0f (%.2f %%) ", p->CutCount[1], 100.0*p->CutCount[1]/p->CutCount[0] );
1188 printf( "Eval = %.0f (%.2f %%) ", p->CutCount[2], 100.0*p->CutCount[2]/p->CutCount[0] );
1189 printf( "Cut = %.0f (%.2f %%) ", p->CutCount[3], 100.0*p->CutCount[3]/p->CutCount[0] );
1190 printf( "Cut/Node = %.2f ", p->CutCount[3] / Gia_ManAndNum(p->pGia) );
1191 printf( "\n" );
1192 printf( "Over = %4d ", p->nCutsOver );
1193 Abc_PrintTime( 0, "Time", Abc_Clock() - p->clkStart );
1194 }
1195 vRes = Sdb_StoIterCuts( p );
1196 Sdb_StoFree( p );
1197 return vRes;
1198}
void Sdb_StoRefObj(Sdb_Sto_t *p, int iObj)
Definition acec2Mult.c:1155
Sdb_Sto_t * Sdb_StoAlloc(Gia_Man_t *pGia, int nCutSize, int nCutNum, int fCutMin, int fTruthMin, int fVerbose)
Definition acec2Mult.c:1114
void Sdb_StoComputeCutsCi(Sdb_Sto_t *p, int iObj)
Definition acec2Mult.c:1147
Vec_Int_t * Sdb_StoIterCuts(Sdb_Sto_t *p)
Definition acec2Mult.c:1044
void Sdb_StoFree(Sdb_Sto_t *p)
Definition acec2Mult.c:1133
void Sdb_StoComputeCutsConst0(Sdb_Sto_t *p, int iObj)
Definition acec2Mult.c:1143
void Sdb_StoComputeCutsNode(Sdb_Sto_t *p, int iObj)
Definition acec2Mult.c:1151
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
#define Gia_ManForEachAnd(p, pObj, i)
Definition gia.h:1214
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition gia.h:1190
#define Gia_ManForEachCiId(p, Id, i)
Definition gia.h:1230
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sdb_StoComputeCutsNode()

void Sdb_StoComputeCutsNode ( Sdb_Sto_t * p,
int iObj )

Definition at line 1151 of file acec2Mult.c.

1152{
1153 Sdb_StoMergeCuts( p, iObj );
1154}
void Sdb_StoMergeCuts(Sdb_Sto_t *p, int iObj)
Definition acec2Mult.c:726
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sdb_StoComputeCutsTest()

void Sdb_StoComputeCutsTest ( Gia_Man_t * pGia)

Definition at line 1199 of file acec2Mult.c.

1200{
1201 Vec_Int_t * vRes = Sdb_StoComputeCutsDetect( pGia );
1202 Vec_IntFree( vRes );
1203}
Vec_Int_t * Sdb_StoComputeCutsDetect(Gia_Man_t *pGia)
Definition acec2Mult.c:1168
Here is the call graph for this function:

◆ Sdb_StoDiffExactlyOne()

int Sdb_StoDiffExactlyOne ( Vec_Wec_t * vCuts,
int Limit,
int * pCut )

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

Synopsis [Cut comparison.]

Description [Find out if there is a cut in vCuts such that pCut has only one extra input. If so, return this input.]

SideEffects []

SeeAlso []

Definition at line 795 of file acec2Mult.c.

796{
797 Vec_Int_t * vCut;
798 int i, k, iNew;
799 // check if it is fully contained in any one
800 Vec_WecForEachLevel( vCuts, vCut, i )
801 {
802 for ( k = 1; k <= pCut[0]; k++ )
803 if ( Vec_IntFind(vCut, pCut[k]) == -1 )
804 break;
805 if ( k == pCut[0] + 1 )
806 return -1;
807 }
808 // check if there is one different
809 Vec_WecForEachLevel( vCuts, vCut, i )
810 {
811 if ( i == Limit )
812 break;
813 for ( iNew = -1, k = 1; k <= pCut[0]; k++ )
814 {
815 if ( Vec_IntFind(vCut, pCut[k]) >= 0 )
816 continue;
817 if ( iNew == -1 )
818 iNew = pCut[k];
819 else
820 break;
821 }
822 if ( k == pCut[0] + 1 && iNew != -1 )
823 return iNew;
824 }
825 return -1;
826}
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition vecWec.h:55
Here is the caller graph for this function:

◆ Sdb_StoDiffExactlyOne2()

int Sdb_StoDiffExactlyOne2 ( Vec_Int_t * vAll,
int * pCut )

Definition at line 865 of file acec2Mult.c.

866{
867 int k, iNew = -1;
868 for ( k = 1; k <= pCut[0]; k++ )
869 {
870 if ( Vec_IntFind(vAll, pCut[k]) >= 0 )
871 continue;
872 if ( iNew == -1 )
873 iNew = pCut[k];
874 else
875 break;
876 }
877 if ( k == pCut[0] + 1 && iNew != -1 )
878 return iNew;
879 return -1;
880}

◆ Sdb_StoDiffExactlyOne3()

int Sdb_StoDiffExactlyOne3 ( Vec_Wec_t * vCuts,
int Limit,
int * pCut,
int * pCount )

Definition at line 827 of file acec2Mult.c.

828{
829 Vec_Int_t * vCut;
830 int i, iNewAll = -1, Count = 0;
831 Vec_WecForEachLevel( vCuts, vCut, i )
832 {
833 int k, iNew = -1;
834 if ( i == Limit )
835 break;
836 for ( k = 1; k <= pCut[0]; k++ )
837 {
838 if ( Vec_IntFind(vCut, pCut[k]) >= 0 )
839 continue;
840 if ( iNew == -1 )
841 iNew = pCut[k];
842 else
843 break;
844 }
845 if ( k == pCut[0] + 1 && iNew != -1 )
846 {
847 if ( iNewAll == -1 )
848 iNewAll = iNew;
849 if ( iNewAll == iNew )
850 Count++;
851 }
852 }
853 *pCount = Count;
854 return iNewAll;
855}

◆ Sdb_StoFindAll()

Vec_Int_t * Sdb_StoFindAll ( Vec_Wec_t * vCuts)

Definition at line 856 of file acec2Mult.c.

857{
858 int i, k, Entry;
859 Vec_Int_t * vCut, * vAll = Vec_IntAlloc( 100 );
860 Vec_WecForEachLevel( vCuts, vCut, i )
861 Vec_IntForEachEntry( vCut, Entry, k )
862 Vec_IntPushUnique( vAll, Entry );
863 return vAll;
864}
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the caller graph for this function:

◆ Sdb_StoFindInputs()

Vec_Int_t * Sdb_StoFindInputs ( Vec_Wec_t * vCuts,
int Front )

Definition at line 881 of file acec2Mult.c.

882{
883 int fVerbose = 0;
884 Vec_Int_t * vCut, * vCounts;
885 Vec_Int_t * vRes = Vec_IntAlloc( 100 );
886 Vec_Int_t * vResA = Vec_IntAlloc( 100 );
887 Vec_Int_t * vResB = Vec_IntAlloc( 100 );
888 int i, k, Entry, Max = 0, Min, MinValue;
889 // find MAX value
890 Vec_WecForEachLevel( vCuts, vCut, i )
891 Vec_IntForEachEntry( vCut, Entry, k )
892 Max = Abc_MaxInt( Max, Entry );
893 // count how many times each value appears
894 vCounts = Vec_IntStart( Max + 1 );
895 Vec_WecForEachLevel( vCuts, vCut, i )
896 Vec_IntForEachEntry( vCut, Entry, k )
897 Vec_IntAddToEntry( vCounts, Entry, 1 );
898 Vec_IntWriteEntry( vCounts, 0, 0 );
899 // print out
900 if ( fVerbose )
901 Vec_IntForEachEntry( vCounts, Entry, k )
902 if ( Entry )
903 printf( "%5d %5d\n", k, Entry );
904 // collect first part
905 MinValue = ABC_INFINITY;
906 Vec_IntForEachEntry( vCounts, Entry, k )
907 if ( Entry )
908 MinValue = Abc_MinInt( MinValue, Entry );
909 if ( MinValue == ABC_INFINITY )
910 return vRes;
911 Min = Vec_IntFind( vCounts, MinValue );
912 Vec_IntPush( vResA, Min );
913 Vec_IntWriteEntry( vCounts, Min, 0 );
914 Vec_IntForEachEntry( vCounts, Entry, k )
915 if ( Entry == MinValue || Entry == 2*MinValue )
916 {
917 Vec_IntPush( vResA, k );
918 Vec_IntWriteEntry( vCounts, k, 0 );
919 }
920 // collect second parts
921 MinValue = Vec_IntEntry( vCounts, Front );
922 Min = Front;
923 Vec_IntPush( vResB, Min );
924 Vec_IntWriteEntry( vCounts, Min, 0 );
925 Vec_IntForEachEntry( vCounts, Entry, k )
926 if ( Entry == MinValue || Entry == 2*MinValue )
927 {
928 Vec_IntPush( vResB, k );
929 Vec_IntWriteEntry( vCounts, k, 0 );
930 }
931 Vec_IntFree( vCounts );
932 Vec_IntPrint( vResA );
933 Vec_IntPrint( vResB );
934 // here we need to order the inputs
935
936 // append
937 Vec_IntAppend( vRes, vResA );
938 Vec_IntAppend( vRes, vResB );
939 Vec_IntFree( vResA );
940 Vec_IntFree( vResB );
941 return vRes;
942}
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
Here is the caller graph for this function:

◆ Sdb_StoFree()

void Sdb_StoFree ( Sdb_Sto_t * p)

Definition at line 1133 of file acec2Mult.c.

1134{
1135 Vec_IntFree( p->vRefs );
1136 Vec_WecFree( p->vCuts );
1137 if ( p->fCutMin )
1138 Vec_MemHashFree( p->vTtMem );
1139 if ( p->fCutMin )
1140 Vec_MemFree( p->vTtMem );
1141 ABC_FREE( p );
1142}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function:

◆ Sdb_StoIterCuts()

Vec_Int_t * Sdb_StoIterCuts ( Sdb_Sto_t * p)

Definition at line 1044 of file acec2Mult.c.

1045{
1046 Vec_Wec_t * v5Cuts = Vec_WecAlloc( 100 );
1047 Vec_Int_t * v5Cut, * vAll, * vRes;
1048 Gia_Obj_t * pObj;
1049 int k, iObj, * pCut, Limit, iNew, iNewFront = -1, iNewBack = -1, iSigned = 0;
1050 Gia_ManForEachAnd( p->pGia, pObj, iObj )
1051 {
1052 int RetValue = Sdb_StoIterCutsOne( p, iObj, 5, &pCut );
1053 if ( RetValue == 0 )
1054 continue;
1055 assert( RetValue == 1 );
1056 assert( pCut[0] == 5 );
1057 v5Cut = Vec_WecPushLevel( v5Cuts );
1058 for ( k = 1; k <= pCut[0]; k++ )
1059 Vec_IntPush( v5Cut, pCut[k] );
1060 }
1061 Limit = Vec_WecSize( v5Cuts );
1062 printf( "Detected %d 5-cuts.\n", Vec_WecSize(v5Cuts) );
1063 vAll = Sdb_StoFindAll( v5Cuts );
1064 Gia_ManForEachAnd( p->pGia, pObj, iObj )
1065 {
1066 int RetValue = Sdb_StoIterCutsOne( p, iObj, 4, &pCut );
1067 if ( RetValue == 0 )
1068 continue;
1069 assert( RetValue >= 2 && RetValue <= 4 );
1070 assert( pCut[0] == 4 );
1071 // find cut, which differs in exactly one input
1072 iNew = Sdb_StoDiffExactlyOne( v5Cuts, Limit, pCut );
1073 if ( iNew == -1 )
1074 continue;
1075 if ( RetValue == 2 )
1076 iNewFront = iNew;
1077 else
1078 iNewBack = iNew;
1079 if ( RetValue == 4 )
1080 iSigned = 1;
1081 // save in the second cut
1082 v5Cut = Vec_WecPushLevel( v5Cuts );
1083 Vec_IntPush( v5Cut, 0 );
1084 for ( k = 1; k <= pCut[0]; k++ )
1085 Vec_IntPush( v5Cut, pCut[k] );
1086 }
1087 Vec_IntFree( vAll );
1088 Vec_WecPrint( v5Cuts, 0 );
1089
1090 if ( iNewFront )
1091 printf( "Front = %d\n", iNewFront );
1092 if ( iNewBack )
1093 printf( "Back = %d\n", iNewBack );
1094 if ( iSigned )
1095 printf( "Sign = %d\n", iSigned );
1096
1097 vRes = Sdb_StoFindInputs( v5Cuts, iNewFront );
1098
1099 Vec_WecFree( v5Cuts );
1100 return vRes;
1101}
int Sdb_StoIterCutsOne(Sdb_Sto_t *p, int iObj, int CutSize, int **ppCut)
Definition acec2Mult.c:955
Vec_Int_t * Sdb_StoFindAll(Vec_Wec_t *vCuts)
Definition acec2Mult.c:856
Vec_Int_t * Sdb_StoFindInputs(Vec_Wec_t *vCuts, int Front)
Definition acec2Mult.c:881
int Sdb_StoDiffExactlyOne(Vec_Wec_t *vCuts, int Limit, int *pCut)
Definition acec2Mult.c:795
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
Definition vecWec.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sdb_StoIterCutsOne()

int Sdb_StoIterCutsOne ( Sdb_Sto_t * p,
int iObj,
int CutSize,
int ** ppCut )

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

Synopsis [Iterate through the cuts.]

Description []

SideEffects []

SeeAlso []

Definition at line 955 of file acec2Mult.c.

956{
957 int fVerbose = 0;
958 Vec_Int_t * vThis = Vec_WecEntry( p->vCuts, iObj );
959 int i, k, * pCut, * pList = Vec_IntArray( vThis );
960 word * pTruth;
961 Sdb_ForEachCut( pList, pCut, i )
962 {
963 if ( pCut[0] != CutSize )
964 continue;
965 if ( pCut[0] == 5 )
966 {
967 pTruth = Vec_MemReadEntry(p->vTtMem, Abc_Lit2Var(pCut[pCut[0]+1]));
968 for ( k = 0; k < s_nFuncTruths5; k++ )
969 if ( s_FuncTruths5[k] == (unsigned)*pTruth )
970 break;
971 if ( k < s_nFuncTruths5 )
972 {
973 if ( fVerbose )
974 {
975 printf( "Object %d has %d-input cut: ", iObj, pCut[0] );
976 for ( k = 1; k <= pCut[0]; k++ )
977 printf( "%d ", pCut[k] );
978 printf( "\n" );
979 }
980 *ppCut = pCut;
981 return 1; // five-input
982 }
983 }
984 if ( pCut[0] == 4 )
985 {
986 pTruth = Vec_MemReadEntry(p->vTtMem, Abc_Lit2Var(pCut[pCut[0]+1]));
987 for ( k = 0; k < s_nFuncTruths4; k++ )
988 if ( s_FuncTruths4[k] == (0xFFFF & (unsigned)*pTruth) )
989 break;
990 if ( k < s_nFuncTruths4 )
991 {
992 if ( fVerbose )
993 {
994 printf( "Object %d has %d-input cut: ", iObj, pCut[0] );
995 for ( k = 1; k <= pCut[0]; k++ )
996 printf( "%d ", pCut[k] );
997 printf( "\n" );
998 }
999 *ppCut = pCut;
1000 return 2; // front
1001 }
1002 }
1003 if ( pCut[0] == 4 )
1004 {
1005 pTruth = Vec_MemReadEntry(p->vTtMem, Abc_Lit2Var(pCut[pCut[0]+1]));
1006 for ( k = 0; k < s_nFuncTruths4a; k++ )
1007 if ( s_FuncTruths4a[k] == (0xFFFF & (unsigned)*pTruth) )
1008 break;
1009 if ( k < s_nFuncTruths4a )
1010 {
1011 if ( fVerbose )
1012 {
1013 printf( "Object %d has %d-input cut: ", iObj, pCut[0] );
1014 for ( k = 1; k <= pCut[0]; k++ )
1015 printf( "%d ", pCut[k] );
1016 printf( "\n" );
1017 }
1018 *ppCut = pCut;
1019 return 3; // back unsigned
1020 }
1021 }
1022 if ( pCut[0] == 4 )
1023 {
1024 pTruth = Vec_MemReadEntry(p->vTtMem, Abc_Lit2Var(pCut[pCut[0]+1]));
1025 for ( k = 0; k < s_nFuncTruths4b; k++ )
1026 if ( s_FuncTruths4b[k] == (0xFFFF & (unsigned)*pTruth) )
1027 break;
1028 if ( k < s_nFuncTruths4b )
1029 {
1030 if ( fVerbose )
1031 {
1032 printf( "Object %d has %d-input cut: ", iObj, pCut[0] );
1033 for ( k = 1; k <= pCut[0]; k++ )
1034 printf( "%d ", pCut[k] );
1035 printf( "\n" );
1036 }
1037 *ppCut = pCut;
1038 return 4; // back signed
1039 }
1040 }
1041 }
1042 return 0;
1043}
#define Sdb_ForEachCut(pList, pCut, i)
Definition acec2Mult.c:317
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
Here is the caller graph for this function:

◆ Sdb_StoMergeCuts()

void Sdb_StoMergeCuts ( Sdb_Sto_t * p,
int iObj )

Definition at line 726 of file acec2Mult.c.

727{
728 Gia_Obj_t * pObj = Gia_ManObj(p->pGia, iObj);
729 int fIsXor = Gia_ObjIsXor(pObj);
730 int nCutSize = p->nCutSize;
731 int nCutNum = p->nCutNum;
732 int fComp0 = Gia_ObjFaninC0(pObj);
733 int fComp1 = Gia_ObjFaninC1(pObj);
734 int Fan0 = Gia_ObjFaninId0(pObj, iObj);
735 int Fan1 = Gia_ObjFaninId1(pObj, iObj);
736 int nCuts0 = Sdb_StoPrepareSet( p, Fan0, 0 );
737 int nCuts1 = Sdb_StoPrepareSet( p, Fan1, 1 );
738 int i, k, nCutsR = 0;
739 Sdb_Cut_t * pCut0, * pCut1, ** pCutsR = p->ppCuts;
740 assert( !Gia_ObjIsBuf(pObj) );
741 assert( !Gia_ObjIsMux(p->pGia, pObj) );
742 Sdb_StoInitResult( p );
743 p->CutCount[0] += nCuts0 * nCuts1;
744 for ( i = 0, pCut0 = p->pCuts[0]; i < nCuts0; i++, pCut0++ )
745 for ( k = 0, pCut1 = p->pCuts[1]; k < nCuts1; k++, pCut1++ )
746 {
747 if ( (int)(pCut0->nLeaves + pCut1->nLeaves) > nCutSize && Sdb_CutCountBits(pCut0->Sign | pCut1->Sign) > nCutSize )
748 continue;
749 p->CutCount[1]++;
750 if ( !Sdb_CutMergeOrder(pCut0, pCut1, pCutsR[nCutsR], nCutSize) )
751 continue;
752 if ( Sdb_CutSetLastCutIsContained(pCutsR, nCutsR) )
753 continue;
754 p->CutCount[2]++;
755 if ( p->fCutMin && Sdb_CutComputeTruth(p, pCut0, pCut1, fComp0, fComp1, pCutsR[nCutsR], fIsXor) )
756 pCutsR[nCutsR]->Sign = Sdb_CutGetSign(pCutsR[nCutsR]);
757 pCutsR[nCutsR]->nTreeLeaves = Sdb_CutTreeLeaves( p, pCutsR[nCutsR] );
758 nCutsR = Sdb_CutSetAddCut( pCutsR, nCutsR, nCutNum );
759 }
760 p->CutCount[3] += nCutsR;
761 p->nCutsOver += nCutsR == nCutNum-1;
762 p->nCutsR = nCutsR;
763 p->Pivot = iObj;
764 // debug printout
765 if ( 0 )
766 {
767 printf( "*** Obj = %4d NumCuts = %4d\n", iObj, nCutsR );
768 for ( i = 0; i < nCutsR; i++ )
769 Sdb_CutPrint( p, iObj, pCutsR[i] );
770 printf( "\n" );
771 }
772 // verify
773 assert( nCutsR > 0 && nCutsR < nCutNum );
774 assert( Sdb_CutSetCheckArray(pCutsR, nCutsR) );
775 // store the cutset
776 Sdb_StoStoreResult( p, iObj, pCutsR, nCutsR );
777 if ( nCutsR > 1 || pCutsR[0]->nLeaves > 1 )
778 Sdb_CutAddUnit( p, iObj );
779}
struct Sdb_Cut_t_ Sdb_Cut_t
Definition acec2Mult.c:281
unsigned nLeaves
Definition acec2Mult.c:289
unsigned nTreeLeaves
Definition acec2Mult.c:288
Here is the caller graph for this function:

◆ Sdb_StoRefObj()

void Sdb_StoRefObj ( Sdb_Sto_t * p,
int iObj )

Definition at line 1155 of file acec2Mult.c.

1156{
1157 Gia_Obj_t * pObj = Gia_ManObj(p->pGia, iObj);
1158 assert( iObj == Vec_IntSize(p->vRefs) );
1159 Vec_IntPush( p->vRefs, 0 );
1160 if ( Gia_ObjIsAnd(pObj) )
1161 {
1162 Vec_IntAddToEntry( p->vRefs, Gia_ObjFaninId0(pObj, iObj), 1 );
1163 Vec_IntAddToEntry( p->vRefs, Gia_ObjFaninId1(pObj, iObj), 1 );
1164 }
1165 else if ( Gia_ObjIsCo(pObj) )
1166 Vec_IntAddToEntry( p->vRefs, Gia_ObjFaninId0(pObj, iObj), 1 );
1167}
Here is the caller graph for this function: