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
ddb34e87
Commit
ddb34e87
authored
Jun 03, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding command 'removepo'.
parent
3bdce84c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
0 deletions
+95
-0
src/base/abc/abcNtk.c
+18
-0
src/base/abci/abc.c
+77
-0
No files found.
src/base/abc/abcNtk.c
View file @
ddb34e87
...
@@ -1514,6 +1514,24 @@ void Abc_NtkSwapOneOutput( Abc_Ntk_t * pNtk, int iOutput )
...
@@ -1514,6 +1514,24 @@ void Abc_NtkSwapOneOutput( Abc_Ntk_t * pNtk, int iOutput )
assert
(
Abc_ObjChild0
(
pObj2
)
==
pChild1Old
);
assert
(
Abc_ObjChild0
(
pObj2
)
==
pChild1Old
);
}
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Abc_NtkRemovePo
(
Abc_Ntk_t
*
pNtk
,
int
iOutput
)
{
Abc_Obj_t
*
pObj
=
Abc_NtkPo
(
pNtk
,
iOutput
);
if
(
Abc_ObjFanin0
(
pObj
)
==
Abc_AigConst1
(
pNtk
)
&&
Abc_ObjFaninC0
(
pObj
)
)
Abc_NtkDeleteObj
(
pObj
);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
/// END OF FILE ///
...
...
src/base/abci/abc.c
View file @
ddb34e87
...
@@ -130,6 +130,7 @@ static int Abc_CommandOrPos ( Abc_Frame_t * pAbc, int argc, cha
...
@@ -130,6 +130,7 @@ static int Abc_CommandOrPos ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandAndPos
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAndPos
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandZeroPo
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandZeroPo
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandSwapPos
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandSwapPos
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandRemovePo
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAddPi
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAddPi
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAppend
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAppend
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandFrames
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandFrames
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
@@ -550,6 +551,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
...
@@ -550,6 +551,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"andpos"
,
Abc_CommandAndPos
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"andpos"
,
Abc_CommandAndPos
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"zeropo"
,
Abc_CommandZeroPo
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"zeropo"
,
Abc_CommandZeroPo
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"swappos"
,
Abc_CommandSwapPos
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"swappos"
,
Abc_CommandSwapPos
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"removepo"
,
Abc_CommandRemovePo
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"addpi"
,
Abc_CommandAddPi
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"addpi"
,
Abc_CommandAddPi
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"append"
,
Abc_CommandAppend
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"append"
,
Abc_CommandAppend
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"frames"
,
Abc_CommandFrames
,
1
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"frames"
,
Abc_CommandFrames
,
1
);
...
@@ -5883,6 +5885,81 @@ usage:
...
@@ -5883,6 +5885,81 @@ usage:
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
int
Abc_CommandRemovePo
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
),
*
pNtkRes
;
int
c
,
iOutput
=
-
1
;
extern
void
Abc_NtkRemovePo
(
Abc_Ntk_t
*
pNtk
,
int
iOutput
);
// set defaults
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Nh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'N'
:
if
(
globalUtilOptind
>=
argc
)
{
Abc_Print
(
-
1
,
"Command line switch
\"
-N
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
iOutput
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
iOutput
<
0
)
goto
usage
;
break
;
default:
goto
usage
;
}
}
if
(
pNtk
==
NULL
)
{
Abc_Print
(
-
1
,
"Empty network.
\n
"
);
return
1
;
}
if
(
!
Abc_NtkIsStrash
(
pNtk
)
)
{
Abc_Print
(
-
1
,
"The network is not strashed.
\n
"
);
return
1
;
}
if
(
iOutput
<
0
)
{
Abc_Print
(
-
1
,
"The output index is not specified.
\n
"
);
return
1
;
}
if
(
iOutput
>=
Abc_NtkPoNum
(
pNtk
)
)
{
Abc_Print
(
-
1
,
"The output index is larger than the allowed POs.
\n
"
);
return
1
;
}
// get the new network
pNtkRes
=
Abc_NtkDup
(
pNtk
);
Abc_NtkRemovePo
(
pNtkRes
,
iOutput
);
Abc_FrameReplaceCurrentNetwork
(
pAbc
,
pNtkRes
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: removepo [-N <num>] [-h]
\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
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandAddPi
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandAddPi
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
),
*
pNtkRes
;
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
),
*
pNtkRes
;
...
...
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