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
78855cc9
Commit
78855cc9
authored
Apr 28, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added supporting dual-output seq miters in &trim.
parent
8a89f1c3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
7 deletions
+53
-7
src/aig/gia/gia.h
+1
-1
src/aig/gia/giaDup.c
+43
-2
src/aig/gia/giaReparam.c
+1
-1
src/base/abci/abc.c
+8
-3
No files found.
src/aig/gia/gia.h
View file @
78855cc9
...
@@ -676,7 +676,7 @@ extern Gia_Man_t * Gia_ManDupDfsSkip( Gia_Man_t * p );
...
@@ -676,7 +676,7 @@ extern Gia_Man_t * Gia_ManDupDfsSkip( Gia_Man_t * p );
extern
Gia_Man_t
*
Gia_ManDupDfsCone
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
);
extern
Gia_Man_t
*
Gia_ManDupDfsCone
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
);
extern
Gia_Man_t
*
Gia_ManDupDfsLitArray
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vLits
);
extern
Gia_Man_t
*
Gia_ManDupDfsLitArray
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vLits
);
extern
Gia_Man_t
*
Gia_ManDupNormalized
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupNormalized
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupTrimmed
(
Gia_Man_t
*
p
,
int
fTrimCis
,
int
fTrimCos
);
extern
Gia_Man_t
*
Gia_ManDupTrimmed
(
Gia_Man_t
*
p
,
int
fTrimCis
,
int
fTrimCos
,
int
fDualOut
);
extern
Gia_Man_t
*
Gia_ManDupOntop
(
Gia_Man_t
*
p
,
Gia_Man_t
*
p2
);
extern
Gia_Man_t
*
Gia_ManDupOntop
(
Gia_Man_t
*
p
,
Gia_Man_t
*
p2
);
extern
Gia_Man_t
*
Gia_ManDupDfsCiMap
(
Gia_Man_t
*
p
,
int
*
pCi2Lit
,
Vec_Int_t
*
vLits
);
extern
Gia_Man_t
*
Gia_ManDupDfsCiMap
(
Gia_Man_t
*
p
,
int
*
pCi2Lit
,
Vec_Int_t
*
vLits
);
extern
Gia_Man_t
*
Gia_ManDupDfsClasses
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupDfsClasses
(
Gia_Man_t
*
p
);
...
...
src/aig/gia/giaDup.c
View file @
78855cc9
...
@@ -901,25 +901,66 @@ Gia_Man_t * Gia_ManDupNormalized( Gia_Man_t * p )
...
@@ -901,25 +901,66 @@ Gia_Man_t * Gia_ManDupNormalized( Gia_Man_t * p )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Gia_Man_t
*
Gia_ManDupTrimmed
(
Gia_Man_t
*
p
,
int
fTrimCis
,
int
fTrimCos
)
Gia_Man_t
*
Gia_ManDupTrimmed
(
Gia_Man_t
*
p
,
int
fTrimCis
,
int
fTrimCos
,
int
fDualOut
)
{
{
Gia_Man_t
*
pNew
;
Gia_Man_t
*
pNew
;
Gia_Obj_t
*
pObj
;
Gia_Obj_t
*
pObj
;
int
i
;
int
i
;
Gia_ManFillValue
(
p
);
pNew
=
Gia_ManStart
(
Gia_ManObjNum
(
p
)
);
pNew
=
Gia_ManStart
(
Gia_ManObjNum
(
p
)
);
pNew
->
pName
=
Abc_UtilStrsav
(
p
->
pName
);
pNew
->
pName
=
Abc_UtilStrsav
(
p
->
pName
);
// check if there are PIs to be added
Gia_ManSetRefs
(
p
);
Gia_ManSetRefs
(
p
);
Gia_ManForEachPi
(
p
,
pObj
,
i
)
if
(
!
fTrimCis
||
pObj
->
Value
>
0
)
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_ManConst0
(
p
)
->
Value
=
0
;
Gia_ManForEachCi
(
p
,
pObj
,
i
)
Gia_ManForEachCi
(
p
,
pObj
,
i
)
if
(
!
fTrimCis
||
pObj
->
Value
>
0
||
Gia_ObjIsRo
(
p
,
pObj
)
)
if
(
!
fTrimCis
||
pObj
->
Value
>
0
||
Gia_ObjIsRo
(
p
,
pObj
)
)
pObj
->
Value
=
Gia_ManAppendCi
(
pNew
);
pObj
->
Value
=
Gia_ManAppendCi
(
pNew
);
Gia_ManForEachAnd
(
p
,
pObj
,
i
)
Gia_ManForEachAnd
(
p
,
pObj
,
i
)
pObj
->
Value
=
Gia_ManAppendAnd
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
),
Gia_ObjFanin1Copy
(
pObj
)
);
pObj
->
Value
=
Gia_ManAppendAnd
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
),
Gia_ObjFanin1Copy
(
pObj
)
);
if
(
fDualOut
&&
fTrimCos
)
{
Gia_Man_t
*
pNonDual
,
*
pTemp
;
Gia_Obj_t
*
pPo0
,
*
pPo1
;
// create non-dual miter
assert
(
(
Gia_ManPoNum
(
p
)
&
1
)
==
0
);
pNonDual
=
Gia_ManTransformMiter
(
p
);
pNonDual
=
Gia_ManSeqStructSweep
(
pTemp
=
pNonDual
,
1
,
1
,
0
);
Gia_ManStop
(
pTemp
);
assert
(
Gia_ManPiNum
(
pNonDual
)
>
0
);
assert
(
2
*
Gia_ManPoNum
(
pNonDual
)
==
Gia_ManPoNum
(
p
)
);
// skip PO pairs corresponding to const0 POs of the non-dual miter
Gia_ManForEachPo
(
pNonDual
,
pObj
,
i
)
if
(
!
Gia_ObjIsConst0
(
Gia_ObjFanin0
(
pObj
))
)
{
pPo0
=
Gia_ManPo
(
p
,
2
*
i
+
0
);
pPo1
=
Gia_ManPo
(
p
,
2
*
i
+
1
);
pPo0
->
Value
=
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pPo0
)
);
pPo1
->
Value
=
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pPo1
)
);
}
Gia_ManStop
(
pNonDual
);
Gia_ManForEachRi
(
p
,
pObj
,
i
)
pObj
->
Value
=
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
)
);
Gia_ManSetRegNum
(
pNew
,
Gia_ManRegNum
(
p
)
);
// cleanup
pNew
=
Gia_ManSeqStructSweep
(
pTemp
=
pNew
,
1
,
1
,
0
);
Gia_ManStop
(
pTemp
);
// trim the PIs
// pNew = Gia_ManDupTrimmed( pTemp = pNew, 1, 0, 0 );
// Gia_ManStop( pTemp );
}
else
{
Gia_ManForEachCo
(
p
,
pObj
,
i
)
Gia_ManForEachCo
(
p
,
pObj
,
i
)
if
(
!
fTrimCos
||
!
Gia_ObjIsConst0
(
Gia_ObjFanin0
(
pObj
))
||
Gia_ObjIsRi
(
p
,
pObj
)
)
if
(
!
fTrimCos
||
!
Gia_ObjIsConst0
(
Gia_ObjFanin0
(
pObj
))
||
Gia_ObjIsRi
(
p
,
pObj
)
)
pObj
->
Value
=
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
)
);
pObj
->
Value
=
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
)
);
Gia_ManSetRegNum
(
pNew
,
Gia_ManRegNum
(
p
)
);
Gia_ManSetRegNum
(
pNew
,
Gia_ManRegNum
(
p
)
);
}
return
pNew
;
return
pNew
;
}
}
...
...
src/aig/gia/giaReparam.c
View file @
78855cc9
...
@@ -151,7 +151,7 @@ Gia_Man_t * Gia_ManReparam( Gia_Man_t * p, int fVerbose )
...
@@ -151,7 +151,7 @@ Gia_Man_t * Gia_ManReparam( Gia_Man_t * p, int fVerbose )
}
}
// perform input trimming
// perform input trimming
pNew
=
Gia_ManDupTrimmed
(
p
,
1
,
0
);
pNew
=
Gia_ManDupTrimmed
(
p
,
1
,
0
,
0
);
if
(
fVerbose
)
if
(
fVerbose
)
{
{
printf
(
"After PI trimming:
\n
"
);
printf
(
"After PI trimming:
\n
"
);
...
...
src/base/abci/abc.c
View file @
78855cc9
...
@@ -22949,8 +22949,9 @@ int Abc_CommandAbc9Trim( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -22949,8 +22949,9 @@ int Abc_CommandAbc9Trim( Abc_Frame_t * pAbc, int argc, char ** argv )
int
c
;
int
c
;
int
fTrimCis
=
1
;
int
fTrimCis
=
1
;
int
fTrimCos
=
1
;
int
fTrimCos
=
1
;
int
fDualOut
=
0
;
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"ioh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"io
d
h"
)
)
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
...
@@ -22960,6 +22961,9 @@ int Abc_CommandAbc9Trim( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -22960,6 +22961,9 @@ int Abc_CommandAbc9Trim( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'o'
:
case
'o'
:
fTrimCos
^=
1
;
fTrimCos
^=
1
;
break
;
break
;
case
'd'
:
fDualOut
^=
1
;
break
;
case
'h'
:
case
'h'
:
goto
usage
;
goto
usage
;
default:
default:
...
@@ -22971,15 +22975,16 @@ int Abc_CommandAbc9Trim( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -22971,15 +22975,16 @@ int Abc_CommandAbc9Trim( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
-
1
,
"Abc_CommandAbc9Trim(): There is no AIG.
\n
"
);
Abc_Print
(
-
1
,
"Abc_CommandAbc9Trim(): There is no AIG.
\n
"
);
return
1
;
return
1
;
}
}
pTemp
=
Gia_ManDupTrimmed
(
pAbc
->
pGia
,
fTrimCis
,
fTrimCos
);
pTemp
=
Gia_ManDupTrimmed
(
pAbc
->
pGia
,
fTrimCis
,
fTrimCos
,
fDualOut
);
Abc_CommandUpdate9
(
pAbc
,
pTemp
);
Abc_CommandUpdate9
(
pAbc
,
pTemp
);
return
0
;
return
0
;
usage:
usage:
Abc_Print
(
-
2
,
"usage: &trim [-ioh]
\n
"
);
Abc_Print
(
-
2
,
"usage: &trim [-io
d
h]
\n
"
);
Abc_Print
(
-
2
,
"
\t
removes PIs without fanout and PO driven by constants
\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
-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
-o : toggle removing POs [default = %s]
\n
"
,
fTrimCos
?
"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
"
);
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