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
9b8d3628
Commit
9b8d3628
authored
Oct 29, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added new bridge commands.
parent
c3298ec2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
173 additions
and
0 deletions
+173
-0
src/base/abci/abc.c
+173
-0
No files found.
src/base/abci/abc.c
View file @
9b8d3628
...
@@ -169,6 +169,10 @@ static int Abc_CommandSenseInput ( Abc_Frame_t * pAbc, int argc, cha
...
@@ -169,6 +169,10 @@ static int Abc_CommandSenseInput ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandNpnLoad
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandNpnLoad
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandNpnSave
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandNpnSave
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandSendAig
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandSendStatus
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandSendCex
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandIStrash
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandIStrash
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandICut
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandICut
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandIRewrite
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandIRewrite
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
@@ -629,6 +633,10 @@ void Abc_Init( Abc_Frame_t * pAbc )
...
@@ -629,6 +633,10 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"npnload"
,
Abc_CommandNpnLoad
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"npnload"
,
Abc_CommandNpnLoad
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"npnsave"
,
Abc_CommandNpnSave
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"npnsave"
,
Abc_CommandNpnSave
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"send_aig"
,
Abc_CommandSendAig
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"send_status"
,
Abc_CommandSendStatus
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Various"
,
"send_cex"
,
Abc_CommandSendCex
,
0
);
Cmd_CommandAdd
(
pAbc
,
"New AIG"
,
"istrash"
,
Abc_CommandIStrash
,
1
);
Cmd_CommandAdd
(
pAbc
,
"New AIG"
,
"istrash"
,
Abc_CommandIStrash
,
1
);
Cmd_CommandAdd
(
pAbc
,
"New AIG"
,
"icut"
,
Abc_CommandICut
,
0
);
Cmd_CommandAdd
(
pAbc
,
"New AIG"
,
"icut"
,
Abc_CommandICut
,
0
);
Cmd_CommandAdd
(
pAbc
,
"New AIG"
,
"irw"
,
Abc_CommandIRewrite
,
1
);
Cmd_CommandAdd
(
pAbc
,
"New AIG"
,
"irw"
,
Abc_CommandIRewrite
,
1
);
...
@@ -11622,6 +11630,171 @@ usage:
...
@@ -11622,6 +11630,171 @@ usage:
return
1
;
return
1
;
}
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandSendAig
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
int
Gia_ManToBridgeAbsNetlist
(
FILE
*
pFile
,
Gia_Man_t
*
p
);
int
c
,
fAndSpace
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"a"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'a'
:
fAndSpace
^=
1
;
break
;
default:
goto
usage
;
}
}
if
(
!
Abc_FrameIsBridgeMode
()
)
{
Abc_Print
(
-
1
,
"The bridge mode is not available.
\n
"
);
return
1
;
}
if
(
fAndSpace
)
{
if
(
pAbc
->
pGia
==
NULL
)
{
Abc_Print
(
-
1
,
"There is no AIG in the &-space.
\n
"
);
return
1
;
}
Gia_ManToBridgeAbsNetlist
(
stdout
,
pAbc
->
pGia
);
}
else
{
extern
Aig_Man_t
*
Abc_NtkToDar
(
Abc_Ntk_t
*
pNtk
,
int
fExors
,
int
fRegisters
);
Aig_Man_t
*
pAig
;
Gia_Man_t
*
pGia
;
if
(
pAbc
->
pNtkCur
==
NULL
)
{
Abc_Print
(
-
1
,
"There is no network in the main-space.
\n
"
);
return
1
;
}
if
(
!
Abc_NtkIsStrash
(
pAbc
->
pNtkCur
)
)
{
Abc_Print
(
-
1
,
"The main-space network is not an AIG.
\n
"
);
return
1
;
}
pAig
=
Abc_NtkToDar
(
pAbc
->
pNtkCur
,
0
,
1
);
pGia
=
Gia_ManFromAig
(
pAig
);
Aig_ManStop
(
pAig
);
Gia_ManToBridgeAbsNetlist
(
stdout
,
pGia
);
Gia_ManStop
(
pGia
);
}
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: send_aig -a
\n
"
);
Abc_Print
(
-
2
,
"
\t
sends current AIG to the bridge
\n
"
);
Abc_Print
(
-
2
,
"
\t
-a : toggle sending AIG from &-space [default = %s]
\n
"
,
fAndSpace
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandSendStatus
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
int
Gia_ManToBridgeResult
(
FILE
*
pFile
,
int
Result
,
Abc_Cex_t
*
pCex
);
int
c
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
""
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
!
Abc_FrameIsBridgeMode
()
)
{
Abc_Print
(
-
1
,
"The bridge mode is not available.
\n
"
);
return
1
;
}
if
(
pAbc
->
Status
==
0
&&
pAbc
->
pCex
==
NULL
)
{
Abc_Print
(
-
1
,
"Status is
\"
sat
\"
, but current CEX is not available.
\n
"
);
return
1
;
}
Gia_ManToBridgeResult
(
stdout
,
pAbc
->
Status
,
pAbc
->
pCex
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: send_status
\n
"
);
Abc_Print
(
-
2
,
"
\t
sends current status to the bridge
\n
"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandSendCex
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
void
Gia_ManFromBridgeCex
(
FILE
*
pFile
,
Abc_Cex_t
*
pCex
);
int
c
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
""
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
!
Abc_FrameIsBridgeMode
()
)
{
Abc_Print
(
-
1
,
"The bridge mode is not available.
\n
"
);
return
1
;
}
if
(
pAbc
->
pCex
==
NULL
)
{
Abc_Print
(
-
1
,
"Current CEX is not available.
\n
"
);
return
1
;
}
Gia_ManFromBridgeCex
(
stdout
,
pAbc
->
pCex
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: send_cex
\n
"
);
Abc_Print
(
-
2
,
"
\t
sends current CEX to the bridge
\n
"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
/**Function*************************************************************
...
...
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