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
36f33bc7
Commit
36f33bc7
authored
Sep 08, 2018
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expriments with functions (bug fixes).
parent
fff82d4d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
33 deletions
+38
-33
src/opt/dau/dauNpn.c
+38
-33
No files found.
src/opt/dau/dauNpn.c
View file @
36f33bc7
...
@@ -499,7 +499,7 @@ void Dau_ExactNpnPrint( Vec_Mem_t * vTtMem, Vec_Int_t * vNodSup, int nVars, int
...
@@ -499,7 +499,7 @@ 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
)
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
)
{
{
FILE
*
pFile
;
FILE
*
pFile
;
char
FileName
[
100
];
char
FileName
[
100
];
...
@@ -518,7 +518,8 @@ void Dau_TablesSave( int nInputs, int nVars, Vec_Mem_t * vTtMem, Vec_Mem_t * vTt
...
@@ -518,7 +518,8 @@ 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.
\n
"
,
Vec_IntSize
(
vMapping
),
Vec_IntSize
(
vNodSup
)
);
printf
(
"Dumped files with %10d functions and %10d classes after exploring %10d frontiers.
\n
"
,
Vec_IntSize
(
vMapping
),
Vec_IntSize
(
vNodSup
),
nFronts
);
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
)
void
Dau_TablesLoad
(
int
nInputs
,
int
nVars
,
Vec_Mem_t
*
vTtMem
,
Vec_Mem_t
*
vTtMemA
,
Vec_Int_t
*
vNodSup
,
Vec_Int_t
*
vMapping
)
...
@@ -597,26 +598,29 @@ int Dau_PrintStats( int nNodes, int nInputs, int nVars, Vec_Int_t * vNodSup, int
...
@@ -597,26 +598,29 @@ 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
nVars
,
Vec_Mem_t
*
vTtMem
,
Vec_Mem_t
*
vTtMemA
,
Vec_Int_t
*
vNodSup
,
Vec_Int_t
*
vMapping
)
int
Dau_InsertFunction
(
Abc_TtHieMan_t
*
pMan
,
word
*
pCur
,
int
nNodes
,
int
nInputs
,
int
nVars0
,
int
nVars
,
Vec_Mem_t
*
vTtMem
,
Vec_Mem_t
*
vTtMemA
,
Vec_Int_t
*
vNodSup
,
Vec_Int_t
*
vMapping
,
int
nFronts
)
{
{
int
DumpDelta
=
100000000
;
int
DumpDelta
=
1000000
;
int
nEntries
=
Vec_MemEntryNum
(
vTtMemA
);
// int DumpDelta = 125000000;
Vec_MemHashInsert
(
vTtMemA
,
pCur
);
// int nEntries = Vec_MemEntryNum(vTtMemA);
if
(
nEntries
==
Vec_MemEntryNum
(
vTtMemA
)
)
// found in the table - not new
// Vec_MemHashInsert( vTtMemA, pCur );
return
0
;
// if ( nEntries == Vec_MemEntryNum(vTtMemA) ) // found in the table - not new
else
// this is a new function
// return 0;
// else // this is a new function
{
{
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
);
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
);
//
Vec_IntPush( vMapping, Entry );
assert
(
Vec_MemEntryNum
(
vTtMemA
)
==
Vec_IntSize
(
vMapping
)
);
//
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
)
//if ( Vec_IntSize(vMapping) % DumpDelta == 0 )
Dau_TablesSave
(
nInputs
,
nVars
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
//if ( Vec_IntSize(vNodSup) % DumpDelta == 0 )
// Dau_TablesSave( nInputs, nVars0, vTtMem, vTtMemA, vNodSup, vMapping, nFronts );
return
0
;
return
0
;
}
}
Phase
=
0
;
Phase
=
0
;
...
@@ -624,8 +628,9 @@ int Dau_InsertFunction( Abc_TtHieMan_t * pMan, word * pCur, int nNodes, int nInp
...
@@ -624,8 +628,9 @@ int Dau_InsertFunction( Abc_TtHieMan_t * pMan, word * pCur, int nNodes, int nInp
// 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(vMapping) % DumpDelta == 0 )
Dau_TablesSave
(
nInputs
,
nVars
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
if
(
Vec_IntSize
(
vNodSup
)
%
DumpDelta
==
0
)
Dau_TablesSave
(
nInputs
,
nVars0
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
nFronts
);
return
1
;
return
1
;
}
}
}
}
...
@@ -688,16 +693,16 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
...
@@ -688,16 +693,16 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
{
{
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
,
n
Supp
+
1
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
+
1
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Supp
+
1
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
+
1
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
}
}
else
else
{
{
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
,
n
Supp
+
1
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
+
1
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
}
}
}
}
nSteps
+=
3
;
nSteps
+=
3
;
...
@@ -711,23 +716,23 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
...
@@ -711,23 +716,23 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
{
{
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
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
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
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
}
}
else
else
{
{
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
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
}
}
nSteps
+=
5
;
nSteps
+=
5
;
}
}
...
@@ -742,37 +747,37 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
...
@@ -742,37 +747,37 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
{
{
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
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
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
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
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
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
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
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
}
}
else
else
{
{
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
,
n
Supp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
n
Vars
,
nSupp
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Entry
);
}
}
nSteps
+=
9
;
nSteps
+=
9
;
}
}
...
@@ -785,7 +790,7 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
...
@@ -785,7 +790,7 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
if
(
nNew
==
0
)
if
(
nNew
==
0
)
break
;
break
;
}
}
Dau_TablesSave
(
nInputs
,
nVars
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
);
Dau_TablesSave
(
nInputs
,
nVars
,
vTtMem
,
vTtMemA
,
vNodSup
,
vMapping
,
Vec_IntSize
(
vNodSup
)
);
Abc_PrintTime
(
1
,
"Total time"
,
Abc_Clock
()
-
clk
);
Abc_PrintTime
(
1
,
"Total time"
,
Abc_Clock
()
-
clk
);
//Dau_ExactNpnPrint( vTtMem, vTtMemA, vNodSup, nVars, nInputs, n );
//Dau_ExactNpnPrint( vTtMem, vTtMemA, vNodSup, nVars, nInputs, n );
Abc_TtHieManStop
(
pMan
);
Abc_TtHieManStop
(
pMan
);
...
...
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