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
7be3e3e6
Commit
7be3e3e6
authored
May 15, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding 'zeropo -o' to replace a given PO by const 1.
parent
533ff698
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
src/base/abc/abcNtk.c
+2
-2
src/base/abci/abc.c
+9
-4
No files found.
src/base/abc/abcNtk.c
View file @
7be3e3e6
...
@@ -1717,7 +1717,7 @@ void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose )
...
@@ -1717,7 +1717,7 @@ void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
void
Abc_NtkDropOneOutput
(
Abc_Ntk_t
*
pNtk
,
int
iOutput
,
int
fSkipSweep
)
void
Abc_NtkDropOneOutput
(
Abc_Ntk_t
*
pNtk
,
int
iOutput
,
int
fSkipSweep
,
int
fUseConst1
)
{
{
Abc_Obj_t
*
pObj
,
*
pConst0
,
*
pFaninNew
;
Abc_Obj_t
*
pObj
,
*
pConst0
,
*
pFaninNew
;
pObj
=
Abc_NtkPo
(
pNtk
,
iOutput
);
pObj
=
Abc_NtkPo
(
pNtk
,
iOutput
);
...
@@ -1727,7 +1727,7 @@ void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput, int fSkipSweep )
...
@@ -1727,7 +1727,7 @@ void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput, int fSkipSweep )
Abc_ObjXorFaninC
(
pObj
,
0
);
Abc_ObjXorFaninC
(
pObj
,
0
);
return
;
return
;
}
}
pConst0
=
Abc_ObjNot
(
Abc_AigConst1
(
pNtk
)
);
pConst0
=
Abc_ObjNot
Cond
(
Abc_AigConst1
(
pNtk
),
!
fUseConst1
);
pFaninNew
=
Abc_ObjNotCond
(
pConst0
,
Abc_ObjFaninC0
(
pObj
)
);
pFaninNew
=
Abc_ObjNotCond
(
pConst0
,
Abc_ObjFaninC0
(
pObj
)
);
Abc_ObjPatchFanin
(
pObj
,
Abc_ObjFanin0
(
pObj
),
pFaninNew
);
Abc_ObjPatchFanin
(
pObj
,
Abc_ObjFanin0
(
pObj
),
pFaninNew
);
assert
(
Abc_ObjChild0
(
pObj
)
==
pConst0
);
assert
(
Abc_ObjChild0
(
pObj
)
==
pConst0
);
...
...
src/base/abci/abc.c
View file @
7be3e3e6
...
@@ -6536,11 +6536,12 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -6536,11 +6536,12 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
//, * pNtkRes = NULL;
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
//, * pNtkRes = NULL;
int
c
,
iOutput
=
-
1
;
int
c
,
iOutput
=
-
1
;
int
fSkipSweep
=
0
;
int
fSkipSweep
=
0
;
extern
void
Abc_NtkDropOneOutput
(
Abc_Ntk_t
*
pNtk
,
int
iOutput
,
int
fSkipSweep
);
int
fUseConst1
=
0
;
extern
void
Abc_NtkDropOneOutput
(
Abc_Ntk_t
*
pNtk
,
int
iOutput
,
int
fSkipSweep
,
int
fUseConst1
);
// set defaults
// set defaults
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Nsh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Ns
o
h"
)
)
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
...
@@ -6558,6 +6559,9 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -6558,6 +6559,9 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv )
case
's'
:
case
's'
:
fSkipSweep
^=
1
;
fSkipSweep
^=
1
;
break
;
break
;
case
'o'
:
fUseConst1
^=
1
;
break
;
default:
default:
goto
usage
;
goto
usage
;
}
}
...
@@ -6589,14 +6593,15 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -6589,14 +6593,15 @@ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv )
// pNtkRes = Abc_NtkDup( pNtk );
// pNtkRes = Abc_NtkDup( pNtk );
// Abc_NtkDropOneOutput( pNtkRes, iOutput );
// Abc_NtkDropOneOutput( pNtkRes, iOutput );
// Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
// Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
Abc_NtkDropOneOutput
(
pNtk
,
iOutput
,
fSkipSweep
);
Abc_NtkDropOneOutput
(
pNtk
,
iOutput
,
fSkipSweep
,
fUseConst1
);
return
0
;
return
0
;
usage:
usage:
Abc_Print
(
-
2
,
"usage: zeropo [-N <num>] [-sh]
\n
"
);
Abc_Print
(
-
2
,
"usage: zeropo [-N <num>] [-s
o
h]
\n
"
);
Abc_Print
(
-
2
,
"
\t
replaces the PO driver by constant 0
\n
"
);
Abc_Print
(
-
2
,
"
\t
replaces the PO driver by constant 0
\n
"
);
Abc_Print
(
-
2
,
"
\t
-N <num> : the zero-based index of the PO to replace [default = %d]
\n
"
,
iOutput
);
Abc_Print
(
-
2
,
"
\t
-N <num> : the zero-based index of the PO to replace [default = %d]
\n
"
,
iOutput
);
Abc_Print
(
-
2
,
"
\t
-s : performs comb sweep after removimg a PO [default = %s]
\n
"
,
!
fSkipSweep
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-s : performs comb sweep after removimg a PO [default = %s]
\n
"
,
!
fSkipSweep
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-o : toggles using const 1 instead of const 0 [default = %s]
\n
"
,
fUseConst1
?
"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