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
0b1cfe88
Commit
0b1cfe88
authored
Feb 27, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added switch -z to command 'removepo' to enable removing const1 outputs.
parent
bc85e512
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 @
0b1cfe88
...
@@ -1607,10 +1607,10 @@ void Abc_NtkSwapOneOutput( Abc_Ntk_t * pNtk, int iOutput )
...
@@ -1607,10 +1607,10 @@ void Abc_NtkSwapOneOutput( Abc_Ntk_t * pNtk, int iOutput )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
void
Abc_NtkRemovePo
(
Abc_Ntk_t
*
pNtk
,
int
iOutput
)
void
Abc_NtkRemovePo
(
Abc_Ntk_t
*
pNtk
,
int
iOutput
,
int
fRemoveConst0
)
{
{
Abc_Obj_t
*
pObj
=
Abc_NtkPo
(
pNtk
,
iOutput
);
Abc_Obj_t
*
pObj
=
Abc_NtkPo
(
pNtk
,
iOutput
);
if
(
Abc_ObjFanin0
(
pObj
)
==
Abc_AigConst1
(
pNtk
)
&&
Abc_ObjFaninC0
(
pObj
)
)
if
(
Abc_ObjFanin0
(
pObj
)
==
Abc_AigConst1
(
pNtk
)
&&
Abc_ObjFaninC0
(
pObj
)
==
fRemoveConst0
)
Abc_NtkDeleteObj
(
pObj
);
Abc_NtkDeleteObj
(
pObj
);
}
}
...
...
src/base/abci/abc.c
View file @
0b1cfe88
...
@@ -5997,11 +5997,12 @@ int Abc_CommandRemovePo( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -5997,11 +5997,12 @@ int Abc_CommandRemovePo( 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
;
extern
void
Abc_NtkRemovePo
(
Abc_Ntk_t
*
pNtk
,
int
iOutput
);
int
fRemoveConst0
=
1
;
extern
void
Abc_NtkRemovePo
(
Abc_Ntk_t
*
pNtk
,
int
iOutput
,
int
fRemoveConst0
);
// set defaults
// set defaults
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Nh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"N
z
h"
)
)
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
...
@@ -6016,6 +6017,9 @@ int Abc_CommandRemovePo( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -6016,6 +6017,9 @@ int Abc_CommandRemovePo( Abc_Frame_t * pAbc, int argc, char ** argv )
if
(
iOutput
<
0
)
if
(
iOutput
<
0
)
goto
usage
;
goto
usage
;
break
;
break
;
case
'z'
:
fRemoveConst0
^=
1
;
break
;
default:
default:
goto
usage
;
goto
usage
;
}
}
...
@@ -6047,13 +6051,14 @@ int Abc_CommandRemovePo( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -6047,13 +6051,14 @@ int Abc_CommandRemovePo( Abc_Frame_t * pAbc, int argc, char ** argv )
// pNtkRes = Abc_NtkDup( pNtk );
// pNtkRes = Abc_NtkDup( pNtk );
// Abc_NtkRemovePo( pNtkRes, iOutput );
// Abc_NtkRemovePo( pNtkRes, iOutput );
// Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
// Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
Abc_NtkRemovePo
(
pNtk
,
iOutput
);
Abc_NtkRemovePo
(
pNtk
,
iOutput
,
fRemoveConst0
);
return
0
;
return
0
;
usage:
usage:
Abc_Print
(
-
2
,
"usage: removepo [-N <num>] [-h]
\n
"
);
Abc_Print
(
-
2
,
"usage: removepo [-N <num>] [-
z
h]
\n
"
);
Abc_Print
(
-
2
,
"
\t
remove PO with number <num> if it is const0
\n
"
);
Abc_Print
(
-
2
,
"
\t
remove PO with number <num> if it is const0
\n
"
);
Abc_Print
(
-
2
,
"
\t
-N <num> : the zero-based index of the PO to remove [default = %d]
\n
"
,
iOutput
);
Abc_Print
(
-
2
,
"
\t
-N <num> : the zero-based index of the PO to remove [default = %d]
\n
"
,
iOutput
);
Abc_Print
(
-
2
,
"
\t
-z : toggle removing const1 instead of const0 [default = %s]
\n
"
,
fRemoveConst0
?
"const0"
:
"const1"
);
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