Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
62638df9
Commit
62638df9
authored
Sep 13, 2018
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expriments with functions (cleanup).
parent
caaca110
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
118 deletions
+37
-118
src/opt/dau/dauNpn.c
+37
-118
No files found.
src/opt/dau/dauNpn.c
View file @
62638df9
...
@@ -509,20 +509,11 @@ void Dau_ExactNpnPrint( Vec_Mem_t * vTtMem, Vec_Int_t * vNodSup, int nVars, int
...
@@ -509,20 +509,11 @@ void Dau_ExactNpnPrint( Vec_Mem_t * vTtMem, Vec_Int_t * vNodSup, int nVars, int
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
void
Dau_TablesSave
(
int
nInputs
,
int
nVars
,
Vec_Mem_t
*
vTtMem
,
Vec_
Mem_t
*
vTtMemA
,
Vec_Int_t
*
vNodSup
,
Vec_Int_t
*
vMapping
,
int
nFronts
,
abctime
clk
)
void
Dau_TablesSave
(
int
nInputs
,
int
nVars
,
Vec_Mem_t
*
vTtMem
,
Vec_
Int_t
*
vNodSup
,
int
nFronts
,
abctime
clk
)
{
{
FILE
*
pFile
;
FILE
*
pFile
;
char
FileName
[
100
];
char
FileName
[
100
];
int
i
,
nWords
=
Abc_TtWordNum
(
nInputs
);
int
i
,
nWords
=
Abc_TtWordNum
(
nInputs
);
/*
// functions
sprintf( FileName, "fun%d%d.ttd", nInputs, nVars );
pFile = fopen( FileName, "wb" );
for ( i = 0; i < Vec_MemEntryNum(vTtMemA); i++ )
fwrite( Vec_MemReadEntry(vTtMemA, i), 8, nWords, pFile );
fwrite( Vec_IntArray(vMapping), 4, Vec_IntSize(vMapping), pFile );
fclose( pFile );
*/
// NPN classes
// NPN classes
sprintf
(
FileName
,
"npn%d%d.ttd"
,
nInputs
,
nVars
);
sprintf
(
FileName
,
"npn%d%d.ttd"
,
nInputs
,
nVars
);
pFile
=
fopen
(
FileName
,
"wb"
);
pFile
=
fopen
(
FileName
,
"wb"
);
...
@@ -530,58 +521,13 @@ void Dau_TablesSave( int nInputs, int nVars, Vec_Mem_t * vTtMem, Vec_Mem_t * vTt
...
@@ -530,58 +521,13 @@ void Dau_TablesSave( int nInputs, int nVars, Vec_Mem_t * vTtMem, Vec_Mem_t * vTt
fwrite
(
Vec_MemReadEntry
(
vTtMem
,
i
),
8
,
nWords
,
pFile
);
fwrite
(
Vec_MemReadEntry
(
vTtMem
,
i
),
8
,
nWords
,
pFile
);
fwrite
(
Vec_IntArray
(
vNodSup
),
4
,
Vec_IntSize
(
vNodSup
),
pFile
);
fwrite
(
Vec_IntArray
(
vNodSup
),
4
,
Vec_IntSize
(
vNodSup
),
pFile
);
fclose
(
pFile
);
fclose
(
pFile
);
// printf( "Dumped files with %10d
functions and %10d
classes after exploring %10d frontiers.\n",
// printf( "Dumped files with %10d classes after exploring %10d frontiers.\n",
// Vec_IntSize(v
Mapping), Vec_IntSize(v
NodSup), nFronts );
// Vec_IntSize(vNodSup), nFronts );
printf
(
"Dumped file
\"
%s
\"
with %10d classes after exploring %10d frontiers. "
,
printf
(
"Dumped file
\"
%s
\"
with %10d classes after exploring %10d frontiers. "
,
FileName
,
Vec_IntSize
(
vNodSup
),
nFronts
);
FileName
,
Vec_IntSize
(
vNodSup
),
nFronts
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
fflush
(
stdout
);
fflush
(
stdout
);
}
}
void
Dau_TablesLoad
(
int
nInputs
,
int
nVars
,
Vec_Mem_t
*
vTtMem
,
Vec_Mem_t
*
vTtMemA
,
Vec_Int_t
*
vNodSup
,
Vec_Int_t
*
vMapping
)
{
char
FileName1
[
100
],
FileName2
[
100
];
int
i
,
RetValue
,
FileSize1
,
FileSize2
,
nWords
=
Abc_TtWordNum
(
nInputs
);
// functions
sprintf
(
FileName1
,
"fun%d%d.ttd"
,
nInputs
,
nVars
);
FileSize1
=
Extra_FileSize
(
FileName1
);
if
(
FileSize1
)
{
word
uTruth
;
FILE
*
pFile
=
fopen
(
FileName1
,
"rb"
);
int
nEntries
=
FileSize1
/
12
;
assert
(
FileSize1
%
12
==
0
);
for
(
i
=
0
;
i
<
nEntries
;
i
++
)
{
RetValue
=
fread
(
&
uTruth
,
8
,
nWords
,
pFile
);
Vec_MemHashInsert
(
vTtMem
,
&
uTruth
);
}
Vec_IntFill
(
vNodSup
,
nEntries
,
-
1
);
RetValue
=
fread
(
Vec_IntArray
(
vNodSup
),
4
,
Vec_IntSize
(
vNodSup
),
pFile
);
fclose
(
pFile
);
}
// classes
sprintf
(
FileName2
,
"npn%d%d.ttd"
,
nInputs
,
nVars
);
FileSize2
=
Extra_FileSize
(
FileName2
);
if
(
FileSize2
)
{
word
uTruth
;
FILE
*
pFile
=
fopen
(
FileName2
,
"rb"
);
int
nEntries
=
FileSize2
/
12
;
assert
(
FileSize2
%
12
==
0
);
for
(
i
=
0
;
i
<
nEntries
;
i
++
)
{
RetValue
=
fread
(
&
uTruth
,
8
,
nWords
,
pFile
);
Vec_MemHashInsert
(
vTtMemA
,
&
uTruth
);
}
Vec_IntFill
(
vMapping
,
nEntries
,
-
1
);
RetValue
=
fread
(
Vec_IntArray
(
vMapping
),
4
,
Vec_IntSize
(
vMapping
),
pFile
);
fclose
(
pFile
);
}
RetValue
=
0
;
if
(
FileSize1
)
printf
(
"Loaded file
\"
%s
\"
with %10d functions and file
\"
%s
\"
with %10d classes.
\n
"
,
FileName1
,
FileSize1
,
FileName2
,
FileSize2
);
}
/**Function*************************************************************
/**Function*************************************************************
...
@@ -658,46 +604,36 @@ int Dau_PrintStats( int nNodes, int nInputs, int nVars, Vec_Int_t * vNodSup, int
...
@@ -658,46 +604,36 @@ int Dau_PrintStats( int nNodes, int nInputs, int nVars, Vec_Int_t * vNodSup, int
fflush
(
stdout
);
fflush
(
stdout
);
return
nNew
;
return
nNew
;
}
}
int
Dau_InsertFunction
(
Abc_TtHieMan_t
*
pMan
,
word
*
pCur
,
int
nNodes
,
int
nInputs
,
int
nVars0
,
int
nVars
,
int
Dau_RunNpn
(
Abc_TtHieMan_t
*
pMan
,
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
)
Vec_Mem_t
*
vTtMem
,
Vec_Mem_t
*
vTtMemA
,
Vec_Int_t
*
vNodSup
,
Vec_Int_t
*
vMapping
,
int
nFronts
,
abctime
clk
)
{
{
int
DumpDelta
=
1000000
;
// int DumpDelta = 125000000;
// int nEntries = Vec_MemEntryNum(vTtMemA);
// Vec_MemHashInsert( vTtMemA, pCur );
// if ( nEntries == Vec_MemEntryNum(vTtMemA) ) // found in the table - not new
// return 0;
// else // this is a new function
{
typedef
unsigned
(
*
TtCanonicizeFunc
)(
Abc_TtHieMan_t
*
p
,
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
,
int
flag
);
typedef
unsigned
(
*
TtCanonicizeFunc
)(
Abc_TtHieMan_t
*
p
,
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
,
int
flag
);
unsigned
Abc_TtCanonicizeWrap
(
TtCanonicizeFunc
func
,
Abc_TtHieMan_t
*
p
,
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
,
int
flag
);
unsigned
Abc_TtCanonicizeWrap
(
TtCanonicizeFunc
func
,
Abc_TtHieMan_t
*
p
,
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
,
int
flag
);
unsigned
Abc_TtCanonicizeAda
(
Abc_TtHieMan_t
*
p
,
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
,
int
iThres
);
unsigned
Abc_TtCanonicizeAda
(
Abc_TtHieMan_t
*
p
,
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
,
int
iThres
);
if
(
nVars
<
6
)
return
Abc_TtCanonicizeWrap
(
Abc_TtCanonicizeAda
,
NULL
,
pTruth
,
nVars
,
pCanonPerm
,
99
);
else
return
Abc_TtCanonicizeWrap
(
Abc_TtCanonicizeAda
,
pMan
,
pTruth
,
nVars
,
pCanonPerm
,
99
);
}
int
Dau_InsertFunction
(
Abc_TtHieMan_t
*
pMan
,
word
*
pCur
,
int
nNodes
,
int
nInputs
,
int
nVars0
,
int
nVars
,
Vec_Mem_t
*
vTtMem
,
Vec_Int_t
*
vNodSup
,
int
nFronts
,
abctime
clk
)
{
int
DumpDelta
=
1000000
;
char
Perm
[
16
]
=
{
0
};
char
Perm
[
16
]
=
{
0
};
int
nVarsNew
=
Abc_TtMinBase
(
pCur
,
NULL
,
nVars
,
nInputs
);
int
nVarsNew
=
Abc_TtMinBase
(
pCur
,
NULL
,
nVars
,
nInputs
);
unsigned
Phase
=
Abc_TtCanonicizeHie
(
pMan
,
pCur
,
nVarsNew
,
Perm
,
1
);
//
unsigned Phase = Abc_TtCanonicizeHie( pMan, pCur, nVarsNew, Perm, 1 );
// unsigned Phase = Abc_TtCanonicizeWrap( Abc_TtCanonicizeAda, pMan, pCur, nVarsNew, Perm, 199
);
unsigned
Phase
=
Dau_RunNpn
(
pMan
,
pCur
,
nVarsNew
,
Perm
);
int
nEntries
=
Vec_MemEntryNum
(
vTtMem
);
int
nEntries
=
Vec_MemEntryNum
(
vTtMem
);
int
Entry
=
Vec_MemHashInsert
(
vTtMem
,
pCur
);
int
Entry
=
Vec_MemHashInsert
(
vTtMem
,
pCur
);
//Vec_IntPush( vMapping, Entry );
//assert( Vec_MemEntryNum(vTtMemA) == Vec_IntSize(vMapping) );
if
(
nEntries
==
Vec_MemEntryNum
(
vTtMem
)
)
// found in the table - not new
if
(
nEntries
==
Vec_MemEntryNum
(
vTtMem
)
)
// found in the table - not new
{
//if ( Vec_IntSize(vMapping) % DumpDelta == 0 )
// Dau_TablesSave( nInputs, nVars0, vTtMem, vTtMemA, vNodSup, vMapping, nFronts, clk );
return
0
;
return
0
;
}
Entry
=
0
;
Entry
=
0
;
Phase
=
0
;
Phase
=
0
;
//printf( "%d ", Dau_CountCompl(pCur[0], nVarsNew) );
// this is a new class
// this is a new class
Vec_IntPush
(
vNodSup
,
(
nNodes
<<
16
)
|
nVarsNew
);
Vec_IntPush
(
vNodSup
,
(
nNodes
<<
16
)
|
nVarsNew
);
assert
(
Vec_MemEntryNum
(
vTtMem
)
==
Vec_IntSize
(
vNodSup
)
);
assert
(
Vec_MemEntryNum
(
vTtMem
)
==
Vec_IntSize
(
vNodSup
)
);
//if ( Vec_IntSize(vMapping) % DumpDelta == 0 )
if
(
Vec_IntSize
(
vNodSup
)
%
DumpDelta
==
0
)
if
(
Vec_IntSize
(
vNodSup
)
%
DumpDelta
==
0
)
Dau_TablesSave
(
nInputs
,
nVars0
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
nFronts
,
clk
);
Dau_TablesSave
(
nInputs
,
nVars0
,
vTtMem
,
vNodSup
,
nFronts
,
clk
);
return
1
;
return
1
;
}
}
}
void
Dau_FunctionEnum
(
int
nInputs
,
int
nVars
,
int
nNodeMax
,
int
fUseTwo
,
int
fReduce
,
int
fVerbose
)
void
Dau_FunctionEnum
(
int
nInputs
,
int
nVars
,
int
nNodeMax
,
int
fUseTwo
,
int
fReduce
,
int
fVerbose
)
{
{
...
@@ -705,31 +641,19 @@ void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fR
...
@@ -705,31 +641,19 @@ void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fR
int
nWords
=
Abc_TtWordNum
(
nInputs
);
word
nSteps
=
0
;
int
nWords
=
Abc_TtWordNum
(
nInputs
);
word
nSteps
=
0
;
Abc_TtHieMan_t
*
pMan
=
Abc_TtHieManStart
(
nInputs
,
5
);
Abc_TtHieMan_t
*
pMan
=
Abc_TtHieManStart
(
nInputs
,
5
);
Vec_Mem_t
*
vTtMem
=
Vec_MemAlloc
(
nWords
,
16
);
Vec_Mem_t
*
vTtMem
=
Vec_MemAlloc
(
nWords
,
16
);
Vec_Mem_t
*
vTtMemA
=
Vec_MemAlloc
(
nWords
,
16
);
Vec_Int_t
*
vNodSup
=
Vec_IntAlloc
(
1
<<
16
);
Vec_Int_t
*
vNodSup
=
Vec_IntAlloc
(
1
<<
16
);
Vec_Int_t
*
vMapping
=
Vec_IntAlloc
(
1
<<
16
);
int
v
,
u
,
k
,
m
,
n
,
Entry
,
nNew
,
Limit
[
32
]
=
{
1
,
2
};
int
v
,
u
,
k
,
m
,
n
,
Entry
,
nNew
,
Limit
[
32
]
=
{
1
,
2
};
word
Truth
[
4
]
=
{
0
};
word
Truth
[
4
]
=
{
0
};
assert
(
nVars
>=
3
&&
nVars
<=
nInputs
&&
nInputs
<=
6
);
assert
(
nVars
>=
3
&&
nVars
<=
nInputs
&&
nInputs
<=
6
);
Vec_MemHashAlloc
(
vTtMem
,
1
<<
16
);
Vec_MemHashAlloc
(
vTtMem
,
1
<<
16
);
Vec_MemHashAlloc
(
vTtMemA
,
1
<<
16
);
if
(
0
)
// load from file
Dau_TablesLoad
(
nInputs
,
nVars
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
else
{
// add constant 0
// add constant 0
Vec_MemHashInsert
(
vTtMem
,
Truth
);
Vec_MemHashInsert
(
vTtMem
,
Truth
);
Vec_MemHashInsert
(
vTtMemA
,
Truth
);
Vec_IntPush
(
vNodSup
,
0
);
// nodes=0, supp=0
Vec_IntPush
(
vNodSup
,
0
);
// nodes=0, supp=0
Vec_IntPush
(
vMapping
,
0
);
// add buffer/inverter
// add buffer/inverter
Abc_TtIthVar
(
Truth
,
0
,
nInputs
);
Abc_TtIthVar
(
Truth
,
0
,
nInputs
);
Abc_TtNot
(
Truth
,
nWords
);
Abc_TtNot
(
Truth
,
nWords
);
Vec_MemHashInsert
(
vTtMem
,
Truth
);
Vec_MemHashInsert
(
vTtMem
,
Truth
);
Vec_MemHashInsert
(
vTtMemA
,
Truth
);
Vec_IntPush
(
vNodSup
,
1
);
// nodes=0, supp=1
Vec_IntPush
(
vNodSup
,
1
);
// nodes=0, supp=1
Vec_IntPush
(
vMapping
,
1
);
}
Dau_PrintStats
(
0
,
nInputs
,
nVars
,
vNodSup
,
0
,
2
,
nSteps
,
0
,
clk
);
Dau_PrintStats
(
0
,
nInputs
,
nVars
,
vNodSup
,
0
,
2
,
nSteps
,
0
,
clk
);
// numerate other functions based on how many nodes they have
// numerate other functions based on how many nodes they have
for
(
n
=
1
;
n
<=
nNodeMax
;
n
++
)
for
(
n
=
1
;
n
<=
nNodeMax
;
n
++
)
...
@@ -757,15 +681,15 @@ void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fR
...
@@ -757,15 +681,15 @@ void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fR
{
{
tGate
=
s_Truths6
[
v
]
&
s_Truths6
[
nSupp
];
tGate
=
s_Truths6
[
v
]
&
s_Truths6
[
nSupp
];
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
+
1
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
+
1
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
+
1
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
+
1
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tGate
=
s_Truths6
[
v
]
^
s_Truths6
[
nSupp
];
tGate
=
s_Truths6
[
v
]
^
s_Truths6
[
nSupp
];
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
+
1
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
+
1
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
nSteps
+=
3
;
nSteps
+=
3
;
}
}
...
@@ -775,22 +699,22 @@ void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fR
...
@@ -775,22 +699,22 @@ void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fR
{
{
tGate
=
s_Truths6
[
v
]
&
s_Truths6
[
k
];
tGate
=
s_Truths6
[
v
]
&
s_Truths6
[
k
];
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tGate
=
s_Truths6
[
v
]
&
~
s_Truths6
[
k
];
tGate
=
s_Truths6
[
v
]
&
~
s_Truths6
[
k
];
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tGate
=
s_Truths6
[
v
]
^
s_Truths6
[
k
];
tGate
=
s_Truths6
[
v
]
^
s_Truths6
[
k
];
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
nSteps
+=
5
;
nSteps
+=
5
;
}
}
...
@@ -800,40 +724,40 @@ void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fR
...
@@ -800,40 +724,40 @@ void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fR
{
{
tGate
=
s_Truths6
[
m
]
&
s_Truths6
[
k
];
tGate
=
s_Truths6
[
m
]
&
s_Truths6
[
k
];
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tGate
=
s_Truths6
[
m
]
&
~
s_Truths6
[
k
];
tGate
=
s_Truths6
[
m
]
&
~
s_Truths6
[
k
];
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tGate
=
~
s_Truths6
[
m
]
&
s_Truths6
[
k
];
tGate
=
~
s_Truths6
[
m
]
&
s_Truths6
[
k
];
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tGate
=
~
s_Truths6
[
m
]
&
~
s_Truths6
[
k
];
tGate
=
~
s_Truths6
[
m
]
&
~
s_Truths6
[
k
];
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tGate
=
s_Truths6
[
m
]
^
s_Truths6
[
k
];
tGate
=
s_Truths6
[
m
]
^
s_Truths6
[
k
];
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
tCur
=
(
tGate
&
Cof1
)
|
(
~
tGate
&
Cof0
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
tGate
=
s_Truths6
[
m
]
^
s_Truths6
[
k
];
tGate
=
s_Truths6
[
m
]
^
s_Truths6
[
k
];
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
nSteps
+=
10
;
nSteps
+=
10
;
}
}
...
@@ -872,7 +796,7 @@ void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fR
...
@@ -872,7 +796,7 @@ void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fR
Cof1
=
(
tGates
[
g1
]
&
Cof11
)
|
(
~
tGates
[
g1
]
&
Cof10
);
Cof1
=
(
tGates
[
g1
]
&
Cof11
)
|
(
~
tGates
[
g1
]
&
Cof10
);
tCur
=
(
tGates
[
g2
]
&
Cof1
)
|
(
~
tGates
[
g2
]
&
Cof0
);
tCur
=
(
tGates
[
g2
]
&
Cof1
)
|
(
~
tGates
[
g2
]
&
Cof0
);
Count2
+=
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Entry
,
clk
);
Count2
+=
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nVars
,
nSupp
,
vTtMem
,
v
NodSup
,
Entry
,
clk
);
}
}
}
}
}
}
...
@@ -881,25 +805,20 @@ void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fR
...
@@ -881,25 +805,20 @@ void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fR
if
(
nNew
==
0
)
if
(
nNew
==
0
)
break
;
break
;
}
}
Dau_TablesSave
(
nInputs
,
nVars
,
vTtMem
,
v
TtMemA
,
vNodSup
,
vMapping
,
Vec_IntSize
(
vNodSup
),
clk
);
Dau_TablesSave
(
nInputs
,
nVars
,
vTtMem
,
v
NodSup
,
Vec_IntSize
(
vNodSup
),
clk
);
Abc_PrintTime
(
1
,
"Total time"
,
Abc_Clock
()
-
clk
);
Abc_PrintTime
(
1
,
"Total time"
,
Abc_Clock
()
-
clk
);
//Dau_DumpFuncs( vTtMem, vNodSup, nVars, nNodeMax );
//Dau_DumpFuncs( vTtMem, vNodSup, nVars, nNodeMax );
//Dau_ExactNpnPrint( vTtMem, v
TtMemA, v
NodSup, nVars, nInputs, n );
//Dau_ExactNpnPrint( vTtMem, vNodSup, nVars, nInputs, n );
Abc_TtHieManStop
(
pMan
);
Abc_TtHieManStop
(
pMan
);
Vec_MemHashFree
(
vTtMem
);
Vec_MemHashFree
(
vTtMem
);
Vec_MemHashFree
(
vTtMemA
);
Vec_MemFreeP
(
&
vTtMem
);
Vec_MemFreeP
(
&
vTtMem
);
Vec_MemFreeP
(
&
vTtMemA
);
Vec_IntFree
(
vNodSup
);
Vec_IntFree
(
vNodSup
);
Vec_IntFree
(
vMapping
);
fflush
(
stdout
);
fflush
(
stdout
);
}
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
ABC_NAMESPACE_IMPL_END
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment