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
726e7039
Commit
726e7039
authored
Sep 30, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changing default values.
parent
80657123
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
15 deletions
+22
-15
src/aig/gia/giaFx.c
+14
-12
src/base/abci/abc.c
+8
-3
No files found.
src/aig/gia/giaFx.c
View file @
726e7039
...
@@ -130,7 +130,7 @@ int Gia_ManFactorNode( Gia_Man_t * p, char * pSop, Vec_Int_t * vLeaves )
...
@@ -130,7 +130,7 @@ int Gia_ManFactorNode( Gia_Man_t * p, char * pSop, Vec_Int_t * vLeaves )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Vec_Wrd_t
*
Gia_ManComputeTruths
(
Gia_Man_t
*
p
,
int
nCutSize
,
int
nLutNum
)
Vec_Wrd_t
*
Gia_ManComputeTruths
(
Gia_Man_t
*
p
,
int
nCutSize
,
int
nLutNum
,
int
fReverse
)
{
{
Vec_Wrd_t
*
vTruths
;
Vec_Wrd_t
*
vTruths
;
Vec_Int_t
vLeaves
;
Vec_Int_t
vLeaves
;
...
@@ -146,6 +146,8 @@ Vec_Wrd_t * Gia_ManComputeTruths( Gia_Man_t * p, int nCutSize, int nLutNum )
...
@@ -146,6 +146,8 @@ Vec_Wrd_t * Gia_ManComputeTruths( Gia_Man_t * p, int nCutSize, int nLutNum )
vLeaves
.
pArray
=
Gia_ObjLutFanins
(
p
,
i
);
vLeaves
.
pArray
=
Gia_ObjLutFanins
(
p
,
i
);
assert
(
Vec_IntCheckUniqueSmall
(
&
vLeaves
)
);
assert
(
Vec_IntCheckUniqueSmall
(
&
vLeaves
)
);
Vec_IntSelectSort
(
Vec_IntArray
(
&
vLeaves
),
Vec_IntSize
(
&
vLeaves
)
);
Vec_IntSelectSort
(
Vec_IntArray
(
&
vLeaves
),
Vec_IntSize
(
&
vLeaves
)
);
if
(
!
fReverse
)
Vec_IntReverseOrder
(
&
vLeaves
);
// compute truth table
// compute truth table
pTruth
=
Gia_ObjComputeTruthTableCut
(
p
,
Gia_ManObj
(
p
,
i
),
&
vLeaves
);
pTruth
=
Gia_ObjComputeTruthTableCut
(
p
,
Gia_ManObj
(
p
,
i
),
&
vLeaves
);
for
(
k
=
0
;
k
<
nWords
;
k
++
)
for
(
k
=
0
;
k
<
nWords
;
k
++
)
...
@@ -179,19 +181,19 @@ int Gia_ManAssignNumbers( Gia_Man_t * p )
...
@@ -179,19 +181,19 @@ int Gia_ManAssignNumbers( Gia_Man_t * p )
Gia_ManObj
(
p
,
i
)
->
Value
=
Counter
++
;
Gia_ManObj
(
p
,
i
)
->
Value
=
Counter
++
;
return
Counter
;
return
Counter
;
}
}
Vec_Wec_t
*
Gia_ManFxRetrieve
(
Gia_Man_t
*
p
,
Vec_Str_t
**
pvCompl
)
Vec_Wec_t
*
Gia_ManFxRetrieve
(
Gia_Man_t
*
p
,
Vec_Str_t
**
pvCompl
,
int
fReverse
)
{
{
Vec_Wec_t
*
vCubes
;
Vec_Wec_t
*
vCubes
;
Vec_Wrd_t
*
vTruths
;
Vec_Wrd_t
*
vTruths
;
Vec_Int_t
*
vCube
,
*
vCover
;
Vec_Int_t
*
vCube
,
*
vCover
;
int
nItems
,
nCutSize
,
nWords
;
int
nItems
,
nCutSize
,
nWords
;
int
i
,
c
,
v
,
Lit
,
Cube
,
Counter
=
0
;
int
i
,
c
,
v
,
Lit
,
Cube
,
Counter
=
0
;
abctime
clk
=
Abc_Clock
();
//
abctime clk = Abc_Clock();
nItems
=
Gia_ManAssignNumbers
(
p
);
nItems
=
Gia_ManAssignNumbers
(
p
);
// compute truth tables
// compute truth tables
nCutSize
=
Gia_ManLutSizeMax
(
p
);
nCutSize
=
Gia_ManLutSizeMax
(
p
);
nWords
=
Abc_Truth6WordNum
(
nCutSize
);
nWords
=
Abc_Truth6WordNum
(
nCutSize
);
vTruths
=
Gia_ManComputeTruths
(
p
,
Abc_MaxInt
(
6
,
nCutSize
),
nItems
-
Gia_ManCiNum
(
p
)
);
vTruths
=
Gia_ManComputeTruths
(
p
,
Abc_MaxInt
(
6
,
nCutSize
),
nItems
-
Gia_ManCiNum
(
p
)
,
fReverse
);
vCover
=
Vec_IntAlloc
(
1
<<
16
);
vCover
=
Vec_IntAlloc
(
1
<<
16
);
// collect cubes
// collect cubes
vCubes
=
Vec_WecAlloc
(
1000
);
vCubes
=
Vec_WecAlloc
(
1000
);
...
@@ -231,7 +233,7 @@ Vec_Wec_t * Gia_ManFxRetrieve( Gia_Man_t * p, Vec_Str_t ** pvCompl )
...
@@ -231,7 +233,7 @@ Vec_Wec_t * Gia_ManFxRetrieve( Gia_Man_t * p, Vec_Str_t ** pvCompl )
assert
(
Counter
*
nWords
==
Vec_WrdSize
(
vTruths
)
);
assert
(
Counter
*
nWords
==
Vec_WrdSize
(
vTruths
)
);
Vec_WrdFree
(
vTruths
);
Vec_WrdFree
(
vTruths
);
Vec_IntFree
(
vCover
);
Vec_IntFree
(
vCover
);
Abc_PrintTime
(
1
,
"Setup time"
,
Abc_Clock
()
-
clk
);
//
Abc_PrintTime( 1, "Setup time", Abc_Clock() - clk );
return
vCubes
;
return
vCubes
;
}
}
...
@@ -310,7 +312,7 @@ Gia_Man_t * Gia_ManFxInsert( Gia_Man_t * p, Vec_Wec_t * vCubes, Vec_Str_t * vCom
...
@@ -310,7 +312,7 @@ Gia_Man_t * Gia_ManFxInsert( Gia_Man_t * p, Vec_Wec_t * vCubes, Vec_Str_t * vCom
Vec_Int_t
*
vOrder
,
*
vFirst
,
*
vCount
,
*
vFanins
;
Vec_Int_t
*
vOrder
,
*
vFirst
,
*
vCount
,
*
vFanins
;
Vec_Int_t
*
vCopies
,
*
vCube
,
*
vMap
;
Vec_Int_t
*
vCopies
,
*
vCube
,
*
vMap
;
int
k
,
c
,
v
,
Lit
,
Var
,
iItem
;
int
k
,
c
,
v
,
Lit
,
Var
,
iItem
;
abctime
clk
=
Abc_Clock
();
//
abctime clk = Abc_Clock();
// prepare the cubes
// prepare the cubes
vOrder
=
Gia_ManFxTopoOrder
(
vCubes
,
Gia_ManCiNum
(
p
),
Vec_StrSize
(
vCompls
),
&
vFirst
,
&
vCount
);
vOrder
=
Gia_ManFxTopoOrder
(
vCubes
,
Gia_ManCiNum
(
p
),
Vec_StrSize
(
vCompls
),
&
vFirst
,
&
vCount
);
if
(
vOrder
==
NULL
)
if
(
vOrder
==
NULL
)
...
@@ -396,7 +398,7 @@ Gia_Man_t * Gia_ManFxInsert( Gia_Man_t * p, Vec_Wec_t * vCubes, Vec_Str_t * vCom
...
@@ -396,7 +398,7 @@ Gia_Man_t * Gia_ManFxInsert( Gia_Man_t * p, Vec_Wec_t * vCubes, Vec_Str_t * vCom
// remove dangling nodes
// remove dangling nodes
pNew
=
Gia_ManCleanup
(
pTemp
=
pNew
);
pNew
=
Gia_ManCleanup
(
pTemp
=
pNew
);
Gia_ManStop
(
pTemp
);
Gia_ManStop
(
pTemp
);
Abc_PrintTime
(
1
,
"Setdn time"
,
Abc_Clock
()
-
clk
);
//
Abc_PrintTime( 1, "Setdn time", Abc_Clock() - clk );
return
pNew
;
return
pNew
;
}
}
...
@@ -411,20 +413,20 @@ Gia_Man_t * Gia_ManFxInsert( Gia_Man_t * p, Vec_Wec_t * vCubes, Vec_Str_t * vCom
...
@@ -411,20 +413,20 @@ Gia_Man_t * Gia_ManFxInsert( Gia_Man_t * p, Vec_Wec_t * vCubes, Vec_Str_t * vCom
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Gia_Man_t
*
Gia_ManPerformFx
(
Gia_Man_t
*
p
,
int
nNewNodesMax
,
int
LitCountMax
,
int
fVerbose
,
int
fVeryVerbose
)
Gia_Man_t
*
Gia_ManPerformFx
(
Gia_Man_t
*
p
,
int
nNewNodesMax
,
int
LitCountMax
,
int
f
Reverse
,
int
f
Verbose
,
int
fVeryVerbose
)
{
{
extern
int
Fx_FastExtract
(
Vec_Wec_t
*
vCubes
,
int
ObjIdMax
,
int
nNewNodesMax
,
int
LitCountMax
,
int
fVerbose
,
int
fVeryVerbose
);
extern
int
Fx_FastExtract
(
Vec_Wec_t
*
vCubes
,
int
ObjIdMax
,
int
nNewNodesMax
,
int
LitCountMax
,
int
fVerbose
,
int
fVeryVerbose
);
Gia_Man_t
*
pNew
=
NULL
;
Gia_Man_t
*
pNew
=
NULL
;
Vec_Wec_t
*
vCubes
;
Vec_Wec_t
*
vCubes
;
Vec_Str_t
*
vCompl
;
Vec_Str_t
*
vCompl
;
abctime
clk
;
//
abctime clk;
assert
(
Gia_ManHasMapping
(
p
)
);
assert
(
Gia_ManHasMapping
(
p
)
);
// collect information
// collect information
vCubes
=
Gia_ManFxRetrieve
(
p
,
&
vCompl
);
vCubes
=
Gia_ManFxRetrieve
(
p
,
&
vCompl
,
fReverse
);
// call the fast extract procedure
// call the fast extract procedure
clk
=
Abc_Clock
();
//
clk = Abc_Clock();
Fx_FastExtract
(
vCubes
,
Vec_StrSize
(
vCompl
),
nNewNodesMax
,
LitCountMax
,
fVerbose
,
fVeryVerbose
);
Fx_FastExtract
(
vCubes
,
Vec_StrSize
(
vCompl
),
nNewNodesMax
,
LitCountMax
,
fVerbose
,
fVeryVerbose
);
Abc_PrintTime
(
1
,
"Fx runtime"
,
Abc_Clock
()
-
clk
);
//
Abc_PrintTime( 1, "Fx runtime", Abc_Clock() - clk );
// insert information
// insert information
pNew
=
Gia_ManFxInsert
(
p
,
vCubes
,
vCompl
);
pNew
=
Gia_ManFxInsert
(
p
,
vCubes
,
vCompl
);
// cleanup
// cleanup
...
...
src/base/abci/abc.c
View file @
726e7039
...
@@ -27415,15 +27415,16 @@ usage:
...
@@ -27415,15 +27415,16 @@ usage:
***********************************************************************/
***********************************************************************/
int
Abc_CommandAbc9Fx
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandAbc9Fx
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
extern
Gia_Man_t
*
Gia_ManPerformFx
(
Gia_Man_t
*
p
,
int
nNewNodesMax
,
int
LitCountMax
,
int
fVerbose
,
int
fVeryVerbose
);
extern
Gia_Man_t
*
Gia_ManPerformFx
(
Gia_Man_t
*
p
,
int
nNewNodesMax
,
int
LitCountMax
,
int
f
Reverse
,
int
f
Verbose
,
int
fVeryVerbose
);
Gia_Man_t
*
pTemp
;
Gia_Man_t
*
pTemp
;
int
nNewNodesMax
=
1000000
;
int
nNewNodesMax
=
1000000
;
int
LitCountMax
=
0
;
int
LitCountMax
=
0
;
int
fReverse
=
0
;
int
c
,
fVerbose
=
0
;
int
c
,
fVerbose
=
0
;
int
fVeryVerbose
=
0
;
int
fVeryVerbose
=
0
;
// set the defaults
// set the defaults
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"NMvh"
))
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"NM
r
vh"
))
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
...
@@ -27449,6 +27450,9 @@ int Abc_CommandAbc9Fx( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -27449,6 +27450,9 @@ int Abc_CommandAbc9Fx( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
LitCountMax
<
0
)
if
(
LitCountMax
<
0
)
goto
usage
;
goto
usage
;
break
;
break
;
case
'r'
:
fReverse
^=
1
;
break
;
case
'v'
:
case
'v'
:
fVerbose
^=
1
;
fVerbose
^=
1
;
break
;
break
;
...
@@ -27469,7 +27473,7 @@ int Abc_CommandAbc9Fx( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -27469,7 +27473,7 @@ int Abc_CommandAbc9Fx( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
-
1
,
"Abc_CommandAbc9Shrink(): Mapping of the AIG is not defined.
\n
"
);
Abc_Print
(
-
1
,
"Abc_CommandAbc9Shrink(): Mapping of the AIG is not defined.
\n
"
);
return
1
;
return
1
;
}
}
pTemp
=
Gia_ManPerformFx
(
pAbc
->
pGia
,
nNewNodesMax
,
LitCountMax
,
fVerbose
,
fVeryVerbose
);
pTemp
=
Gia_ManPerformFx
(
pAbc
->
pGia
,
nNewNodesMax
,
LitCountMax
,
f
Reverse
,
f
Verbose
,
fVeryVerbose
);
if
(
pTemp
!=
NULL
)
if
(
pTemp
!=
NULL
)
Abc_FrameUpdateGia
(
pAbc
,
pTemp
);
Abc_FrameUpdateGia
(
pAbc
,
pTemp
);
else
else
...
@@ -27481,6 +27485,7 @@ usage:
...
@@ -27481,6 +27485,7 @@ usage:
Abc_Print
(
-
2
,
"
\t
extract shared logic using the classical
\"
fast_extract
\"
algorithm
\n
"
);
Abc_Print
(
-
2
,
"
\t
extract shared logic using the classical
\"
fast_extract
\"
algorithm
\n
"
);
Abc_Print
(
-
2
,
"
\t
-N <num> : max number of divisors to extract during this run [default = %d]
\n
"
,
nNewNodesMax
);
Abc_Print
(
-
2
,
"
\t
-N <num> : max number of divisors to extract during this run [default = %d]
\n
"
,
nNewNodesMax
);
Abc_Print
(
-
2
,
"
\t
-M <num> : upper bound on literal count of divisors to extract [default = %d]
\n
"
,
LitCountMax
);
Abc_Print
(
-
2
,
"
\t
-M <num> : upper bound on literal count of divisors to extract [default = %d]
\n
"
,
LitCountMax
);
Abc_Print
(
-
2
,
"
\t
-r : reversing variable order during ISOP computation [default = %s]
\n
"
,
fReverse
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : print verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : print verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
return
1
;
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