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
96fa84ad
Commit
96fa84ad
authored
Nov 11, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added switch -i to &filter to use FIs instead of FOs.
parent
2a028aa1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
16 deletions
+30
-16
src/aig/gia/gia.h
+1
-1
src/aig/gia/giaEquiv.c
+20
-10
src/base/abci/abc.c
+9
-5
No files found.
src/aig/gia/gia.h
View file @
96fa84ad
...
...
@@ -1160,7 +1160,7 @@ extern int Gia_ManCountChoiceNodes( Gia_Man_t * p );
extern
int
Gia_ManCountChoices
(
Gia_Man_t
*
p
);
extern
int
Gia_ManFilterEquivsForSpeculation
(
Gia_Man_t
*
pGia
,
char
*
pName1
,
char
*
pName2
,
int
fLatchA
,
int
fLatchB
);
extern
int
Gia_ManFilterEquivsUsingParts
(
Gia_Man_t
*
pGia
,
char
*
pName1
,
char
*
pName2
);
extern
void
Gia_ManFilterEquivsUsingLatches
(
Gia_Man_t
*
pGia
,
int
fFlopsOnly
,
int
fFlopsWith
);
extern
void
Gia_ManFilterEquivsUsingLatches
(
Gia_Man_t
*
pGia
,
int
fFlopsOnly
,
int
fFlopsWith
,
int
fUseRiDrivers
);
/*=== giaFanout.c =========================================================*/
extern
void
Gia_ObjAddFanout
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
Gia_Obj_t
*
pFanout
);
extern
void
Gia_ObjRemoveFanout
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
Gia_Obj_t
*
pFanout
);
...
...
src/aig/gia/giaEquiv.c
View file @
96fa84ad
...
...
@@ -2144,21 +2144,32 @@ int Gia_ManFilterEquivsUsingParts( Gia_Man_t * pGia, char * pName1, char * pName
SeeAlso []
***********************************************************************/
void
Gia_ManFilterEquivsUsingLatches
(
Gia_Man_t
*
pGia
,
int
fFlopsOnly
,
int
fFlopsWith
)
void
Gia_ManFilterEquivsUsingLatches
(
Gia_Man_t
*
pGia
,
int
fFlopsOnly
,
int
fFlopsWith
,
int
fUseRiDrivers
)
{
Vec_Int_t
*
vNodes
;
Gia_Obj_t
*
pObj
;
Gia_Obj_t
*
pObjR
;
Vec_Int_t
*
vNodes
,
*
vFfIds
;
int
i
,
k
,
iObj
,
iNext
,
iPrev
,
iRepr
;
int
iLitsOld
=
0
,
iLitsNew
=
0
;
assert
(
fFlopsOnly
^
fFlopsWith
);
vNodes
=
Vec_IntAlloc
(
100
);
// remove all noo-flop constants
// select nodes "flop" node IDs
vFfIds
=
Vec_IntStart
(
Gia_ManObjNum
(
pGia
)
);
if
(
fUseRiDrivers
)
{
Gia_ManForEachRi
(
pGia
,
pObjR
,
i
)
Vec_IntWriteEntry
(
vFfIds
,
Gia_ObjFaninId0p
(
pGia
,
pObjR
),
1
);
}
else
{
Gia_ManForEachRo
(
pGia
,
pObjR
,
i
)
Vec_IntWriteEntry
(
vFfIds
,
Gia_ObjId
(
pGia
,
pObjR
),
1
);
}
// remove all non-flop constants
Gia_ManForEachConst
(
pGia
,
i
)
{
iLitsOld
++
;
pObj
=
Gia_ManObj
(
pGia
,
i
);
assert
(
pGia
->
pNexts
[
i
]
==
0
);
if
(
!
Gia_ObjIsRo
(
pGia
,
pObj
)
)
if
(
!
Vec_IntEntry
(
vFfIds
,
i
)
)
Gia_ObjUnsetRepr
(
pGia
,
i
);
else
iLitsNew
++
;
...
...
@@ -2171,8 +2182,7 @@ void Gia_ManFilterEquivsUsingLatches( Gia_Man_t * pGia, int fFlopsOnly, int fFlo
Vec_IntClear
(
vNodes
);
Gia_ClassForEachObj
(
pGia
,
i
,
iObj
)
{
pObj
=
Gia_ManObj
(
pGia
,
iObj
);
if
(
Gia_ObjIsRo
(
pGia
,
pObj
)
)
if
(
Vec_IntEntry
(
vFfIds
,
iObj
)
)
Vec_IntPush
(
vNodes
,
iObj
);
iLitsOld
++
;
}
...
...
@@ -2207,8 +2217,7 @@ void Gia_ManFilterEquivsUsingLatches( Gia_Man_t * pGia, int fFlopsOnly, int fFlo
int
fSeenFlop
=
0
;
Gia_ClassForEachObj
(
pGia
,
i
,
iObj
)
{
pObj
=
Gia_ManObj
(
pGia
,
iObj
);
if
(
Gia_ObjIsRo
(
pGia
,
pObj
)
)
if
(
Vec_IntEntry
(
vFfIds
,
iObj
)
)
fSeenFlop
=
1
;
iLitsOld
++
;
iLitsNew
++
;
...
...
@@ -2230,6 +2239,7 @@ void Gia_ManFilterEquivsUsingLatches( Gia_Man_t * pGia, int fFlopsOnly, int fFlo
}
}
Vec_IntFree
(
vNodes
);
Vec_IntFree
(
vFfIds
);
Abc_Print
(
1
,
"The number of literals: Before = %d. After = %d.
\n
"
,
iLitsOld
,
iLitsNew
);
}
...
...
src/base/abci/abc.c
View file @
96fa84ad
...
...
@@ -30253,10 +30253,10 @@ usage:
int
Abc_CommandAbc9Filter
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
char
*
pFileName1
=
NULL
,
*
pFileName2
=
NULL
;
int
fFlopsOnly
=
0
,
fFlopsWith
=
0
;
int
fFlopsOnly
=
0
,
fFlopsWith
=
0
,
fUseRiDrivers
=
0
;
int
c
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"fgvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"fg
i
vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -30266,6 +30266,9 @@ int Abc_CommandAbc9Filter( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'g'
:
fFlopsWith
^=
1
;
break
;
case
'i'
:
fUseRiDrivers
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -30292,7 +30295,7 @@ int Abc_CommandAbc9Filter( Abc_Frame_t * pAbc, int argc, char ** argv )
}
// filter using one of the choices
if
(
fFlopsOnly
^
fFlopsWith
)
Gia_ManFilterEquivsUsingLatches
(
pAbc
->
pGia
,
fFlopsOnly
,
fFlopsWith
);
Gia_ManFilterEquivsUsingLatches
(
pAbc
->
pGia
,
fFlopsOnly
,
fFlopsWith
,
fUseRiDrivers
);
// get the input file name
if
(
argc
==
globalUtilOptind
+
2
)
{
...
...
@@ -30307,11 +30310,12 @@ int Abc_CommandAbc9Filter( Abc_Frame_t * pAbc, int argc, char ** argv )
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &filter [-fgvh] <PartA_FileName> <PartB_FileName>
\n
"
);
Abc_Print
(
-
2
,
"usage: &filter [-fg
i
vh] <PartA_FileName> <PartB_FileName>
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs filtering of equivalence classes
\n
"
);
Abc_Print
(
-
2
,
"
\t
(if Parts A/B are given, removes classes composed of one part)
\n
"
);
Abc_Print
(
-
2
,
"
\t
-f : toggle removing all elements except flops [default = %s]
\n
"
,
fFlopsOnly
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-g : toggle removing removing classes without flops [default = %s]
\n
"
,
fFlopsWith
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-g : toggle removing classes without flops [default = %s]
\n
"
,
fFlopsWith
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-i : toggle using flop inputs instead of flop outputs [default = %s]
\n
"
,
fUseRiDrivers
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"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