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 )
}
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
;
Abc_TtHieMan_t
*
pMan
=
Abc_TtHieManStart
(
p
->
nVars
,
5
);
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
extern
unsigned
Abc_TtCanonicizePerm
(
word
*
pTruth
,
int
nVars
,
char
*
pCanonPerm
);
extern
unsigned
Abc_TtCanonicizePhase
(
word
*
pTruth
,
int
nVars
);
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 ==========================================================*/
extern
int
Abc_TtCountOnesInCofsQuick
(
word
*
pTruth
,
int
nVars
,
int
*
pStore
);
/*=== 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
{
int
nNew
;
printf
(
"Nodes = %2d. "
,
nNodes
);
printf
(
"New%d = %
8
d. "
,
nInputs
,
iStop
-
iStart
);
printf
(
"Total%d = %
8
d. "
,
nInputs
,
iStop
);
printf
(
"New%d = %
8
d. "
,
nVars
,
nNew
=
Dau_CountFuncs
(
vNodSup
,
iStart
,
iStop
,
nVars
)
);
printf
(
"Total%d = %
8
d. "
,
nVars
,
Dau_CountFuncs
(
vNodSup
,
0
,
iStop
,
nVars
)
);
printf
(
"New%d = %
10
d. "
,
nInputs
,
iStop
-
iStart
);
printf
(
"Total%d = %
10
d. "
,
nInputs
,
iStop
);
printf
(
"New%d = %
10
d. "
,
nVars
,
nNew
=
Dau_CountFuncs
(
vNodSup
,
iStart
,
iStop
,
nVars
)
);
printf
(
"Total%d = %
10
d. "
,
nVars
,
Dau_CountFuncs
(
vNodSup
,
0
,
iStop
,
nVars
)
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
fflush
(
stdout
);
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
};
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
Entry
=
Vec_MemHashInsert
(
vTtMem
,
pCur
);
if
(
nEntries
==
Vec_MemEntryNum
(
vTtMem
)
)
// found in the table - not new
return
0
;
Phase
=
0
;
nEntries
=
0
;
// this is a new class
Vec_IntPush
(
vNodSup
,
(
nNodes
<<
16
)
|
nVarsNew
);
assert
(
Vec_MemEntryNum
(
vTtMem
)
==
Vec_IntSize
(
vNodSup
)
);
...
...
@@ -497,6 +499,7 @@ void Dau_FunctionEnum( int nInputs, int nVars, int fVerbose )
{
abctime
clk
=
Abc_Clock
();
int
nWords
=
Abc_TtWordNum
(
nInputs
);
Abc_TtHieMan_t
*
pMan
=
Abc_TtHieManStart
(
nInputs
,
5
);
Vec_Mem_t
*
vTtMem
=
Vec_MemAlloc
(
nWords
,
16
);
Vec_Int_t
*
vNodSup
=
Vec_IntAlloc
(
1
<<
16
);
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 )
{
tGate
=
s_Truths6
[
v
]
&
s_Truths6
[
nSupp
];
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
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
+
1
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
+
1
,
vTtMem
,
vNodSup
);
}
else
{
tGate
=
s_Truths6
[
v
]
^
s_Truths6
[
nSupp
];
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 )
{
tGate
=
s_Truths6
[
v
]
&
s_Truths6
[
k
];
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
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
tGate
=
s_Truths6
[
v
]
&
~
s_Truths6
[
k
];
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
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
}
else
{
tGate
=
s_Truths6
[
v
]
^
s_Truths6
[
k
];
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 )
{
tGate
=
s_Truths6
[
m
]
&
s_Truths6
[
k
];
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
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
tGate
=
s_Truths6
[
m
]
&
~
s_Truths6
[
k
];
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
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
tGate
=
~
s_Truths6
[
m
]
&
s_Truths6
[
k
];
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
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
tGate
=
~
s_Truths6
[
m
]
&
~
s_Truths6
[
k
];
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
);
Dau_InsertFunction
(
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
Dau_InsertFunction
(
pMan
,
&
tCur
,
n
,
nInputs
,
nSupp
,
vTtMem
,
vNodSup
);
}
else
{
tGate
=
s_Truths6
[
m
]
^
s_Truths6
[
k
];
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 )
break
;
}
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_MemFreeP
(
&
vTtMem
);
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