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
197c65be
Commit
197c65be
authored
Sep 07, 2018
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expriments with functions.
parent
a8d3b9a5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
28 deletions
+31
-28
src/base/abci/abcNpn.c
+0
-4
src/opt/dau/dau.h
+3
-0
src/opt/dau/dauNpn.c
+28
-24
No files found.
src/base/abci/abcNpn.c
View file @
197c65be
...
@@ -295,10 +295,6 @@ void Abc_TruthNpnPerform( Abc_TtStore_t * p, int NpnType, int fVerbose )
...
@@ -295,10 +295,6 @@ void Abc_TruthNpnPerform( Abc_TtStore_t * p, int NpnType, int fVerbose )
}
}
else
if
(
NpnType
==
7
)
else
if
(
NpnType
==
7
)
{
{
extern
unsigned
Abc_TtCanonicizeHie
(
Abc_TtHieMan_t
*
p
,
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
,
int
fExact
);
extern
Abc_TtHieMan_t
*
Abc_TtHieManStart
(
int
nVars
,
int
nLevels
);
extern
void
Abc_TtHieManStop
(
Abc_TtHieMan_t
*
p
);
int
fExact
=
0
;
int
fExact
=
0
;
Abc_TtHieMan_t
*
pMan
=
Abc_TtHieManStart
(
p
->
nVars
,
5
);
Abc_TtHieMan_t
*
pMan
=
Abc_TtHieManStart
(
p
->
nVars
,
5
);
for
(
i
=
0
;
i
<
p
->
nFuncs
;
i
++
)
for
(
i
=
0
;
i
<
p
->
nFuncs
;
i
++
)
...
...
src/opt/dau/dau.h
View file @
197c65be
...
@@ -80,6 +80,9 @@ extern unsigned Abc_TtCanonicize( word * pTruth, int nVars, char * pCanonPe
...
@@ -80,6 +80,9 @@ extern unsigned Abc_TtCanonicize( word * pTruth, int nVars, char * pCanonPe
extern
unsigned
Abc_TtCanonicizePerm
(
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
);
extern
unsigned
Abc_TtCanonicizePerm
(
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
);
extern
unsigned
Abc_TtCanonicizePhase
(
word
*
pTruth
,
int
nVars
);
extern
unsigned
Abc_TtCanonicizePhase
(
word
*
pTruth
,
int
nVars
);
extern
int
Abc_TtCountOnesInCofsSimple
(
word
*
pTruth
,
int
nVars
,
int
*
pStore
);
extern
int
Abc_TtCountOnesInCofsSimple
(
word
*
pTruth
,
int
nVars
,
int
*
pStore
);
extern
unsigned
Abc_TtCanonicizeHie
(
Abc_TtHieMan_t
*
p
,
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
,
int
fExact
);
extern
Abc_TtHieMan_t
*
Abc_TtHieManStart
(
int
nVars
,
int
nLevels
);
extern
void
Abc_TtHieManStop
(
Abc_TtHieMan_t
*
p
);
/*=== dauCount.c ==========================================================*/
/*=== dauCount.c ==========================================================*/
extern
int
Abc_TtCountOnesInCofsQuick
(
word
*
pTruth
,
int
nVars
,
int
*
pStore
);
extern
int
Abc_TtCountOnesInCofsQuick
(
word
*
pTruth
,
int
nVars
,
int
*
pStore
);
/*=== dauDsd.c ==========================================================*/
/*=== dauDsd.c ==========================================================*/
...
...
src/opt/dau/dauNpn.c
View file @
197c65be
...
@@ -471,23 +471,25 @@ int Dau_PrintStats( int nNodes, int nInputs, int nVars, Vec_Int_t * vNodSup, int
...
@@ -471,23 +471,25 @@ int Dau_PrintStats( int nNodes, int nInputs, int nVars, Vec_Int_t * vNodSup, int
{
{
int
nNew
;
int
nNew
;
printf
(
"Nodes = %2d. "
,
nNodes
);
printf
(
"Nodes = %2d. "
,
nNodes
);
printf
(
"New%d = %
8
d. "
,
nInputs
,
iStop
-
iStart
);
printf
(
"New%d = %
10
d. "
,
nInputs
,
iStop
-
iStart
);
printf
(
"Total%d = %
8
d. "
,
nInputs
,
iStop
);
printf
(
"Total%d = %
10
d. "
,
nInputs
,
iStop
);
printf
(
"New%d = %
8
d. "
,
nVars
,
nNew
=
Dau_CountFuncs
(
vNodSup
,
iStart
,
iStop
,
nVars
)
);
printf
(
"New%d = %
10
d. "
,
nVars
,
nNew
=
Dau_CountFuncs
(
vNodSup
,
iStart
,
iStop
,
nVars
)
);
printf
(
"Total%d = %
8
d. "
,
nVars
,
Dau_CountFuncs
(
vNodSup
,
0
,
iStop
,
nVars
)
);
printf
(
"Total%d = %
10
d. "
,
nVars
,
Dau_CountFuncs
(
vNodSup
,
0
,
iStop
,
nVars
)
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
fflush
(
stdout
);
fflush
(
stdout
);
return
nNew
;
return
nNew
;
}
}
int
Dau_InsertFunction
(
word
*
pCur
,
int
nNodes
,
int
nInputs
,
int
nVars
,
Vec_Mem_t
*
vTtMem
,
Vec_Int_t
*
vNodSup
)
int
Dau_InsertFunction
(
Abc_TtHieMan_t
*
pMan
,
word
*
pCur
,
int
nNodes
,
int
nInputs
,
int
nVars
,
Vec_Mem_t
*
vTtMem
,
Vec_Int_t
*
vNodSup
)
{
{
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_TtCanonicize
(
pCur
,
nVarsNew
,
Perm
)
;
unsigned
Phase
=
nVarsNew
?
Abc_TtCanonicizeHie
(
pMan
,
pCur
,
nVarsNew
,
Perm
,
1
)
:
0
;
int
nEntries
=
Vec_MemEntryNum
(
vTtMem
);
int
nEntries
=
Vec_MemEntryNum
(
vTtMem
);
int
Entry
=
Vec_MemHashInsert
(
vTtMem
,
pCur
);
int
Entry
=
Vec_MemHashInsert
(
vTtMem
,
pCur
);
if
(
nEntries
==
Vec_MemEntryNum
(
vTtMem
)
)
// found in the table - not new
if
(
nEntries
==
Vec_MemEntryNum
(
vTtMem
)
)
// found in the table - not new
return
0
;
return
0
;
Phase
=
0
;
nEntries
=
0
;
// 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
)
);
...
@@ -497,6 +499,7 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
...
@@ -497,6 +499,7 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
{
{
abctime
clk
=
Abc_Clock
();
abctime
clk
=
Abc_Clock
();
int
nWords
=
Abc_TtWordNum
(
nInputs
);
int
nWords
=
Abc_TtWordNum
(
nInputs
);
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_Int_t
*
vNodSup
=
Vec_IntAlloc
(
1
<<
16
);
Vec_Int_t
*
vNodSup
=
Vec_IntAlloc
(
1
<<
16
);
int
v
,
g
,
k
,
m
,
n
,
Entry
,
nNew
,
iStart
=
1
,
iStop
=
2
;
int
v
,
g
,
k
,
m
,
n
,
Entry
,
nNew
,
iStart
=
1
,
iStop
=
2
;
...
@@ -539,16 +542,16 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
...
@@ -539,16 +542,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
(
&
tCur
,
n
,
nInputs
,
nSupp
+
1
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
+
1
,
vTtMem
,
vNodSup
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
+
1
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
+
1
,
vTtMem
,
vNodSup
);
}
}
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
(
&
tCur
,
n
,
nInputs
,
nSupp
+
1
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
+
1
,
vTtMem
,
vNodSup
);
}
}
}
}
}
}
...
@@ -561,23 +564,23 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
...
@@ -561,23 +564,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
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
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
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
}
}
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
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
}
}
}
}
}
}
...
@@ -591,37 +594,37 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
...
@@ -591,37 +594,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
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
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
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
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
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
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
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
tCur
=
(
tGate
&
Cof0
)
|
(
~
tGate
&
Cof1
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
}
}
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
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
}
}
}
}
}
}
...
@@ -634,7 +637,8 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
...
@@ -634,7 +637,8 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
break
;
break
;
}
}
Abc_PrintTime
(
1
,
"Total time"
,
Abc_Clock
()
-
clk
);
Abc_PrintTime
(
1
,
"Total time"
,
Abc_Clock
()
-
clk
);
Dau_ExactNpnPrint
(
vTtMem
,
vNodSup
,
nVars
,
nInputs
,
n
);
//Dau_ExactNpnPrint( vTtMem, vNodSup, nVars, nInputs, n );
Abc_TtHieManStop
(
pMan
);
Vec_MemHashFree
(
vTtMem
);
Vec_MemHashFree
(
vTtMem
);
Vec_MemFreeP
(
&
vTtMem
);
Vec_MemFreeP
(
&
vTtMem
);
Vec_IntFree
(
vNodSup
);
Vec_IntFree
(
vNodSup
);
...
...
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