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
58e1041a
Commit
58e1041a
authored
Apr 28, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified command 'eliminate' to perform traditional 'eliminate -1'.
parent
a33821ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
12 deletions
+48
-12
src/base/abc/abcMinBase.c
+26
-4
src/base/abci/abc.c
+22
-8
No files found.
src/base/abc/abcMinBase.c
View file @
58e1041a
...
@@ -511,6 +511,14 @@ int Abc_NodeCountAppearances( Abc_Obj_t * pFanin, Abc_Obj_t * pFanout )
...
@@ -511,6 +511,14 @@ int Abc_NodeCountAppearances( Abc_Obj_t * pFanin, Abc_Obj_t * pFanout )
assert
(
iFanin
>=
0
&&
iFanin
<
Hop_ManPiNum
(
pMan
)
);
assert
(
iFanin
>=
0
&&
iFanin
<
Hop_ManPiNum
(
pMan
)
);
return
Hop_ObjFanoutCount
(
(
Hop_Obj_t
*
)
pFanout
->
pData
,
Hop_IthVar
(
pMan
,
iFanin
)
);
return
Hop_ObjFanoutCount
(
(
Hop_Obj_t
*
)
pFanout
->
pData
,
Hop_IthVar
(
pMan
,
iFanin
)
);
}
}
int
Abc_NodeCountAppearancesAll
(
Abc_Obj_t
*
pNode
)
{
Abc_Obj_t
*
pFanout
;
int
i
,
Count
=
0
;
Abc_ObjForEachFanout
(
pNode
,
pFanout
,
i
)
Count
+=
Abc_NodeCountAppearances
(
pNode
,
pFanout
);
return
Count
;
}
/**Function*************************************************************
/**Function*************************************************************
...
@@ -570,7 +578,7 @@ int Abc_NodeCollapse1( Abc_Obj_t * pFanin, Abc_Obj_t * pFanout, Vec_Ptr_t * vFan
...
@@ -570,7 +578,7 @@ int Abc_NodeCollapse1( Abc_Obj_t * pFanin, Abc_Obj_t * pFanout, Vec_Ptr_t * vFan
Abc_NtkDeleteObj_rec
(
pFanout
,
1
);
Abc_NtkDeleteObj_rec
(
pFanout
,
1
);
return
1
;
return
1
;
}
}
int
Abc_NtkEliminate1
(
Abc_Ntk_t
*
pNtk
,
int
nMaxSize
,
int
fReverse
,
int
fVerbose
)
int
Abc_NtkEliminate1
One
(
Abc_Ntk_t
*
pNtk
,
int
ElimValue
,
int
nMaxSize
,
int
fReverse
,
int
fVerbose
)
{
{
Vec_Ptr_t
*
vFanouts
,
*
vFanins
,
*
vNodes
;
Vec_Ptr_t
*
vFanouts
,
*
vFanins
,
*
vNodes
;
Abc_Obj_t
*
pNode
,
*
pFanout
;
Abc_Obj_t
*
pNode
,
*
pFanout
;
...
@@ -600,10 +608,10 @@ int Abc_NtkEliminate1( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbos
...
@@ -600,10 +608,10 @@ int Abc_NtkEliminate1( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbos
if
(
Abc_ObjFaninNum
(
pNode
)
>
nMaxSize
)
if
(
Abc_ObjFaninNum
(
pNode
)
>
nMaxSize
)
continue
;
continue
;
// skip nodes with more than one fanout
// skip nodes with more than one fanout
if
(
Abc_ObjFanoutNum
(
pNode
)
!=
1
)
//
if ( Abc_ObjFanoutNum(pNode) != 1 )
continue
;
//
continue;
// skip nodes that appear in the FF of their fanout more than once
// skip nodes that appear in the FF of their fanout more than once
if
(
Abc_NodeCountAppearances
(
pNode
,
Abc_ObjFanout
(
pNode
,
0
)
)
!=
1
)
if
(
Abc_NodeCountAppearances
All
(
pNode
)
>
ElimValue
+
2
)
continue
;
continue
;
Abc_ObjForEachFanout
(
pNode
,
pFanout
,
k
)
Abc_ObjForEachFanout
(
pNode
,
pFanout
,
k
)
if
(
Abc_NodeCollapseSuppSize
(
pNode
,
pFanout
,
vFanins
)
>
nMaxSize
)
if
(
Abc_NodeCollapseSuppSize
(
pNode
,
pFanout
,
vFanins
)
>
nMaxSize
)
...
@@ -634,6 +642,20 @@ int Abc_NtkEliminate1( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbos
...
@@ -634,6 +642,20 @@ int Abc_NtkEliminate1( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbos
ABC_FREE
(
pPermFanout
);
ABC_FREE
(
pPermFanout
);
return
1
;
return
1
;
}
}
int
Abc_NtkEliminate1
(
Abc_Ntk_t
*
pNtk
,
int
ElimValue
,
int
nMaxSize
,
int
fReverse
,
int
fVerbose
)
{
int
i
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
int
nNodes
=
Abc_NtkNodeNum
(
pNtk
);
// printf( "%d ", nNodes );
if
(
!
Abc_NtkEliminate1One
(
pNtk
,
ElimValue
,
nMaxSize
,
fReverse
,
fVerbose
)
)
return
0
;
if
(
nNodes
==
Abc_NtkNodeNum
(
pNtk
)
)
break
;
}
return
1
;
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
/// END OF FILE ///
...
...
src/base/abci/abc.c
View file @
58e1041a
...
@@ -3668,23 +3668,36 @@ int Abc_CommandEliminate( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -3668,23 +3668,36 @@ int Abc_CommandEliminate( Abc_Frame_t * pAbc, int argc, char ** argv )
{
{
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
int
nMaxSize
;
int
nMaxSize
;
int
ElimValue
;
int
fGreedy
;
int
fGreedy
;
int
fReverse
;
int
fReverse
;
int
fVerbose
;
int
fVerbose
;
int
c
;
int
c
;
extern
int
Abc_NtkEliminate
(
Abc_Ntk_t
*
pNtk
,
int
nMaxSize
,
int
fReverse
,
int
fVerbose
);
extern
int
Abc_NtkEliminate
(
Abc_Ntk_t
*
pNtk
,
int
nMaxSize
,
int
fReverse
,
int
fVerbose
);
extern
int
Abc_NtkEliminate1
(
Abc_Ntk_t
*
pNtk
,
int
nMaxSize
,
int
fReverse
,
int
fVerbose
);
extern
int
Abc_NtkEliminate1
(
Abc_Ntk_t
*
pNtk
,
int
ElimValue
,
int
nMaxSize
,
int
fReverse
,
int
fVerbose
);
// set the defaults
// set the defaults
nMaxSize
=
30
;
nMaxSize
=
30
;
fGreedy
=
0
;
ElimValue
=
-
1
;
fReverse
=
0
;
fGreedy
=
0
;
fVerbose
=
0
;
fReverse
=
0
;
fVerbose
=
0
;
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Ngrvh"
))
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"
V
Ngrvh"
))
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
case
'V'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-V
\"
should be followed by an integer that is -1 or larger.
\n
"
);
goto
usage
;
}
ElimValue
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
ElimValue
<
-
1
)
goto
usage
;
break
;
case
'N'
:
case
'N'
:
if
(
globalUtilOptind
>=
argc
)
if
(
globalUtilOptind
>=
argc
)
{
{
...
@@ -3734,13 +3747,14 @@ int Abc_CommandEliminate( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -3734,13 +3747,14 @@ int Abc_CommandEliminate( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
fGreedy
)
if
(
fGreedy
)
Abc_NtkEliminate
(
pNtk
,
nMaxSize
,
fReverse
,
fVerbose
);
Abc_NtkEliminate
(
pNtk
,
nMaxSize
,
fReverse
,
fVerbose
);
else
else
Abc_NtkEliminate1
(
pNtk
,
nMaxSize
,
fReverse
,
fVerbose
);
Abc_NtkEliminate1
(
pNtk
,
ElimValue
,
nMaxSize
,
fReverse
,
fVerbose
);
return
0
;
return
0
;
usage:
usage:
Abc_Print
(
-
2
,
"usage: eliminate [-N <num>] [-grvh]
\n
"
);
Abc_Print
(
-
2
,
"usage: eliminate [-
V
N <num>] [-grvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
traditional
\"
eliminate -1
\"
, which collapses the node into its fanout
\n
"
);
Abc_Print
(
-
2
,
"
\t
traditional
\"
eliminate -1
\"
, which collapses the node into its fanout
\n
"
);
Abc_Print
(
-
2
,
"
\t
if the node's variable appears in the fanout's factored form only once
\n
"
);
Abc_Print
(
-
2
,
"
\t
if the node's variable appears in the fanout's factored form only once
\n
"
);
Abc_Print
(
-
2
,
"
\t
-V <num> : the
\"
value
\"
parameter used by
\"
eliminate
\"
in SIS [default = %d]
\n
"
,
ElimValue
);
Abc_Print
(
-
2
,
"
\t
-N <num> : the maximum node support after collapsing [default = %d]
\n
"
,
nMaxSize
);
Abc_Print
(
-
2
,
"
\t
-N <num> : the maximum node support after collapsing [default = %d]
\n
"
,
nMaxSize
);
Abc_Print
(
-
2
,
"
\t
-g : toggle using greedy eliminate (without
\"
value
\"
) [default = %s]
\n
"
,
fGreedy
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-g : toggle using greedy eliminate (without
\"
value
\"
) [default = %s]
\n
"
,
fGreedy
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-r : use the reverse topological order [default = %s]
\n
"
,
fReverse
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-r : use the reverse topological order [default = %s]
\n
"
,
fReverse
?
"yes"
:
"no"
);
...
...
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