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
f09afdf2
Commit
f09afdf2
authored
Jul 20, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added switch &trim -c to additionally remove direct connections (POs fed by PIs).
parent
aa78ce56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
3 deletions
+66
-3
src/aig/gia/giaDup.c
+52
-0
src/base/abci/abc.c
+14
-3
No files found.
src/aig/gia/giaDup.c
View file @
f09afdf2
...
...
@@ -1005,6 +1005,58 @@ Gia_Man_t * Gia_ManDupTrimmed( Gia_Man_t * p, int fTrimCis, int fTrimCos, int fD
/**Function*************************************************************
Synopsis [Removes POs driven by PIs and PIs without fanout.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Gia_Man_t
*
Gia_ManDupTrimmed2
(
Gia_Man_t
*
p
)
{
Gia_Man_t
*
pNew
;
Gia_Obj_t
*
pObj
;
int
i
;
// start new manager
pNew
=
Gia_ManStart
(
Gia_ManObjNum
(
p
)
);
pNew
->
pName
=
Abc_UtilStrsav
(
p
->
pName
);
// check if there are PIs to be added
Gia_ManCreateRefs
(
p
);
// discount references of POs
Gia_ManForEachPo
(
p
,
pObj
,
i
)
Gia_ObjRefFanin0Dec
(
p
,
pObj
);
// check if PIs are left
Gia_ManForEachPi
(
p
,
pObj
,
i
)
if
(
Gia_ObjRefs
(
p
,
pObj
)
)
break
;
if
(
i
==
Gia_ManPiNum
(
p
)
)
// there is no PIs - add dummy PI
Gia_ManAppendCi
(
pNew
);
// add the ROs
Gia_ManFillValue
(
p
);
Gia_ManConst0
(
p
)
->
Value
=
0
;
Gia_ManForEachCi
(
p
,
pObj
,
i
)
if
(
Gia_ObjRefs
(
p
,
pObj
)
||
Gia_ObjIsRo
(
p
,
pObj
)
)
pObj
->
Value
=
Gia_ManAppendCi
(
pNew
);
Gia_ManForEachAnd
(
p
,
pObj
,
i
)
pObj
->
Value
=
Gia_ManAppendAnd
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
),
Gia_ObjFanin1Copy
(
pObj
)
);
// check if there are POs to be added
Gia_ManForEachPo
(
p
,
pObj
,
i
)
if
(
!
Gia_ObjIsConst0
(
Gia_ObjFanin0
(
pObj
))
&&
!
Gia_ObjIsPi
(
p
,
Gia_ObjFanin0
(
pObj
))
)
break
;
if
(
i
==
Gia_ManPoNum
(
p
)
)
// there is no POs - add dummy PO
Gia_ManAppendCo
(
pNew
,
0
);
Gia_ManForEachCo
(
p
,
pObj
,
i
)
if
(
(
!
Gia_ObjIsConst0
(
Gia_ObjFanin0
(
pObj
))
&&
!
Gia_ObjIsPi
(
p
,
Gia_ObjFanin0
(
pObj
)))
||
Gia_ObjIsRi
(
p
,
pObj
)
)
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
)
);
Gia_ManSetRegNum
(
pNew
,
Gia_ManRegNum
(
p
)
);
assert
(
!
Gia_ManHasDangling
(
pNew
)
);
return
pNew
;
}
/**Function*************************************************************
Synopsis [Duplicates AIG in the DFS order while putting CIs first.]
Description []
...
...
src/base/abci/abc.c
View file @
f09afdf2
...
...
@@ -23555,13 +23555,14 @@ usage:
***********************************************************************/
int
Abc_CommandAbc9Trim
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Gia_Man_t
*
pTemp
;
Gia_Man_t
*
pTemp
,
*
pTemp2
;
int
c
;
int
fTrimCis
=
1
;
int
fTrimCos
=
1
;
int
fDualOut
=
0
;
int
fPoFedByPi
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"iodh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"io
c
dh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -23571,6 +23572,9 @@ int Abc_CommandAbc9Trim( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'o'
:
fTrimCos
^=
1
;
break
;
case
'c'
:
fPoFedByPi
^=
1
;
break
;
case
'd'
:
fDualOut
^=
1
;
break
;
...
...
@@ -23586,14 +23590,21 @@ int Abc_CommandAbc9Trim( Abc_Frame_t * pAbc, int argc, char ** argv )
return
1
;
}
pTemp
=
Gia_ManDupTrimmed
(
pAbc
->
pGia
,
fTrimCis
,
fTrimCos
,
fDualOut
);
if
(
fPoFedByPi
)
{
extern
Gia_Man_t
*
Gia_ManDupTrimmed2
(
Gia_Man_t
*
p
);
pTemp
=
Gia_ManDupTrimmed2
(
pTemp2
=
pTemp
);
Gia_ManStop
(
pTemp2
);
}
Abc_CommandUpdate9
(
pAbc
,
pTemp
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &trim [-iodh]
\n
"
);
Abc_Print
(
-
2
,
"usage: &trim [-io
c
dh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
removes PIs without fanout and PO driven by constants
\n
"
);
Abc_Print
(
-
2
,
"
\t
-i : toggle removing PIs [default = %s]
\n
"
,
fTrimCis
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-o : toggle removing POs [default = %s]
\n
"
,
fTrimCos
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-c : toggle additionally removing POs fed by PIs [default = %s]
\n
"
,
fPoFedByPi
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-d : toggle using dual-output miter [default = %s]
\n
"
,
fDualOut
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
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