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
0fc13478
Unverified
Commit
0fc13478
authored
Aug 19, 2021
by
alanminko
Committed by
GitHub
Aug 19, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #133 from twier/inv_get_name_mangling_fix
Fix name-mangling behavior of inv_get
parents
77760dd8
b82a7f46
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
7 deletions
+41
-7
src/base/wlc/wlcAbc.c
+9
-1
src/base/wlc/wlcCom.c
+32
-6
No files found.
src/base/wlc/wlcAbc.c
View file @
0fc13478
...
@@ -140,7 +140,7 @@ void Wlc_NtkPrintInvStats( Wlc_Ntk_t * pNtk, Vec_Int_t * vCounts, int fVerbose )
...
@@ -140,7 +140,7 @@ void Wlc_NtkPrintInvStats( Wlc_Ntk_t * pNtk, Vec_Int_t * vCounts, int fVerbose )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Abc_Ntk_t
*
Wlc_NtkGetInv
(
Wlc_Ntk_t
*
pNtk
,
Vec_Int_t
*
vInv
)
Abc_Ntk_t
*
Wlc_NtkGetInv
(
Wlc_Ntk_t
*
pNtk
,
Vec_Int_t
*
vInv
,
Vec_Ptr_t
*
vNamesIn
)
{
{
extern
Vec_Int_t
*
Pdr_InvCounts
(
Vec_Int_t
*
vInv
);
extern
Vec_Int_t
*
Pdr_InvCounts
(
Vec_Int_t
*
vInv
);
extern
Vec_Str_t
*
Pdr_InvPrintStr
(
Vec_Int_t
*
vInv
,
Vec_Int_t
*
vCounts
);
extern
Vec_Str_t
*
Pdr_InvPrintStr
(
Vec_Int_t
*
vInv
,
Vec_Int_t
*
vCounts
);
...
@@ -166,9 +166,17 @@ Abc_Ntk_t * Wlc_NtkGetInv( Wlc_Ntk_t * pNtk, Vec_Int_t * vInv )
...
@@ -166,9 +166,17 @@ Abc_Ntk_t * Wlc_NtkGetInv( Wlc_Ntk_t * pNtk, Vec_Int_t * vInv )
if
(
Entry
==
0
)
if
(
Entry
==
0
)
continue
;
continue
;
pMainObj
=
Abc_NtkCreatePi
(
pMainNtk
);
pMainObj
=
Abc_NtkCreatePi
(
pMainNtk
);
// If vNamesIn is given, take names from there for as many entries as possible
// otherwise generate names from counter
if
(
vNamesIn
!=
NULL
&&
i
<
Vec_PtrSize
(
vNamesIn
))
{
Abc_ObjAssignName
(
pMainObj
,
(
char
*
)
Vec_PtrEntry
(
vNamesIn
,
i
),
NULL
);
}
else
{
sprintf
(
Buffer
,
"pi%d"
,
i
);
sprintf
(
Buffer
,
"pi%d"
,
i
);
Abc_ObjAssignName
(
pMainObj
,
Buffer
,
NULL
);
Abc_ObjAssignName
(
pMainObj
,
Buffer
,
NULL
);
}
}
}
if
(
Abc_NtkPiNum
(
pMainNtk
)
!=
nInputs
)
if
(
Abc_NtkPiNum
(
pMainNtk
)
!=
nInputs
)
{
{
printf
(
"Mismatch between number of inputs and the number of literals in the invariant.
\n
"
);
printf
(
"Mismatch between number of inputs and the number of literals in the invariant.
\n
"
);
...
...
src/base/wlc/wlcCom.c
View file @
0fc13478
...
@@ -1727,15 +1727,19 @@ usage:
...
@@ -1727,15 +1727,19 @@ usage:
******************************************************************************/
******************************************************************************/
int
Abc_CommandInvGet
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandInvGet
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
extern
Abc_Ntk_t
*
Wlc_NtkGetInv
(
Wlc_Ntk_t
*
pNtk
,
Vec_Int_t
*
vInv
);
extern
Abc_Ntk_t
*
Wlc_NtkGetInv
(
Wlc_Ntk_t
*
pNtk
,
Vec_Int_t
*
vInv
,
Vec_Ptr_t
*
vNamesIn
);
Abc_Ntk_t
*
pMainNtk
;
Abc_Ntk_t
*
pMainNtk
;
Wlc_Ntk_t
*
pNtk
=
Wlc_AbcGetNtk
(
pAbc
);
Wlc_Ntk_t
*
pNtk
=
Wlc_AbcGetNtk
(
pAbc
);
int
c
,
fVerbose
=
0
;
int
c
,
i
,
fVerbose
=
0
,
fFlopNamesFromGia
=
0
;
Vec_Ptr_t
*
vNamesIn
=
NULL
;
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"vh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"
f
vh"
)
)
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
case
'f'
:
fFlopNamesFromGia
^=
1
;
break
;
case
'v'
:
case
'v'
:
fVerbose
^=
1
;
fVerbose
^=
1
;
break
;
break
;
...
@@ -1750,16 +1754,38 @@ int Abc_CommandInvGet( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -1750,16 +1754,38 @@ int Abc_CommandInvGet( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
1
,
"Abc_CommandInvGet(): Invariant is not available.
\n
"
);
Abc_Print
(
1
,
"Abc_CommandInvGet(): Invariant is not available.
\n
"
);
return
0
;
return
0
;
}
}
// See if we shall and can copy the PI names from the current GIA
if
(
fFlopNamesFromGia
)
{
if
(
pAbc
->
pGia
==
NULL
)
{
Abc_Print
(
1
,
"Abc_CommandInvGet(): No network in &-space, cannot copy names.
\n
"
);
fFlopNamesFromGia
=
0
;
}
else
{
vNamesIn
=
Vec_PtrStart
(
Gia_ManRegNum
(
pAbc
->
pGia
)
);
for
(
i
=
0
;
i
<
Gia_ManRegNum
(
pAbc
->
pGia
);
++
i
)
{
// Only the registers
Vec_PtrSetEntry
(
vNamesIn
,
i
,
Extra_UtilStrsav
(
(
const
char
*
)
Vec_PtrEntry
(
pAbc
->
pGia
->
vNamesIn
,
Gia_ManPiNum
(
pAbc
->
pGia
)
+
i
)
)
);
}
}
}
// derive the network
// derive the network
pMainNtk
=
Wlc_NtkGetInv
(
pNtk
,
Wlc_AbcGetInv
(
pAbc
)
);
pMainNtk
=
Wlc_NtkGetInv
(
pNtk
,
Wlc_AbcGetInv
(
pAbc
),
vNamesIn
);
// Delete names
if
(
vNamesIn
)
Vec_PtrFree
(
vNamesIn
);
// replace the current network
// replace the current network
if
(
pMainNtk
)
if
(
pMainNtk
)
Abc_FrameReplaceCurrentNetwork
(
pAbc
,
pMainNtk
);
Abc_FrameReplaceCurrentNetwork
(
pAbc
,
pMainNtk
);
return
0
;
return
0
;
usage:
usage:
Abc_Print
(
-
2
,
"usage: inv_get [-vh]
\n
"
);
Abc_Print
(
-
2
,
"usage: inv_get [-
f
vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
places invariant found by PDR as the current network in the main-space
\n
"
);
Abc_Print
(
-
2
,
"
\t
places invariant found by PDR as the current network in the main-space
\n
"
);
Abc_Print
(
-
2
,
"
\t
(in the case of
\'
sat
\'
or
\'
undecided
\'
, inifity clauses are used)
\n
"
);
Abc_Print
(
-
2
,
"
\t
(in the case of
\'
sat
\'
or
\'
undecided
\'
, infinity clauses are used)
\n
"
);
Abc_Print
(
-
2
,
"
\t
-f : toggle reading flop names from the &-space [default = %s]
\n
"
,
fFlopNamesFromGia
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"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
"
);
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