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
4d8c72d0
Commit
4d8c72d0
authored
Jan 17, 2019
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing the problem with outputting word-level CEXes after retiming.
parent
d05f89d9
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
18 deletions
+44
-18
src/base/io/io.c
+36
-18
src/base/main/main.h
+2
-0
src/base/main/mainFrame.c
+4
-0
src/base/main/mainInt.h
+1
-0
src/base/wlc/wlcCom.c
+1
-0
No files found.
src/base/io/io.c
View file @
4d8c72d0
...
...
@@ -2292,6 +2292,35 @@ ABC_NAMESPACE_IMPL_END
ABC_NAMESPACE_IMPL_START
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
IoCommandPrintLatchName
(
FILE
*
pFile
,
Abc_Ntk_t
*
pNtk
,
Abc_Obj_t
*
pObj
,
char
*
pObjName
,
Abc_Cex_t
*
pCex
,
Abc_Cex_t
*
pCare
)
{
int
ii
,
NameLen
=
strlen
(
pObjName
);
// check if there is a PI with a matching name
Abc_Obj_t
*
pObjPi
;
Abc_NtkForEachPi
(
pNtk
,
pObjPi
,
ii
)
if
(
!
strncmp
(
Abc_ObjName
(
pObjPi
),
pObjName
,
NameLen
)
&&
!
strncmp
(
Abc_ObjName
(
pObjPi
)
+
NameLen
,
"_init"
,
5
)
)
{
if
(
!
pCare
||
Abc_InfoHasBit
(
pCare
->
pData
,
pCare
->
nRegs
+
ii
)
)
fprintf
(
pFile
,
"%s@%d=%c
\n
"
,
pObjName
,
0
,
'0'
+
Abc_InfoHasBit
(
pCex
->
pData
,
pCare
->
nRegs
+
ii
)
);
break
;
}
if
(
ii
!=
Abc_NtkPiNum
(
pNtk
)
)
return
;
if
(
!
strncmp
(
pObjName
,
"abc_reset_flop"
,
14
)
)
return
;
fprintf
(
pFile
,
"%s@0=%c
\n
"
,
pObjName
,
'0'
+
(
pObj
?
!
Abc_LatchIsInit0
(
pObj
)
:
0
)
);
}
/**Function*************************************************************
...
...
@@ -2307,6 +2336,7 @@ ABC_NAMESPACE_IMPL_START
int
IoCommandWriteCex
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Abc_Ntk_t
*
pNtk
;
Vec_Ptr_t
*
vNamesIn
=
NULL
;
char
*
pFileName
;
int
c
,
fNames
=
0
;
int
fMinimize
=
0
;
...
...
@@ -2417,6 +2447,7 @@ int IoCommandWriteCex( Abc_Frame_t * pAbc, int argc, char **argv )
else
if
(
fNames
)
{
Abc_Cex_t
*
pCare
=
NULL
;
char
*
pObjName
=
NULL
;
if
(
fMinimize
)
{
extern
Aig_Man_t
*
Abc_NtkToDar
(
Abc_Ntk_t
*
pNtk
,
int
fExors
,
int
fRegisters
);
...
...
@@ -2445,25 +2476,12 @@ int IoCommandWriteCex( Abc_Frame_t * pAbc, int argc, char **argv )
fprintf
(
pFile
,
"
\n
"
);
fprintf
(
pFile
,
"# COUNTEREXAMPLE LENGTH: %u
\n
"
,
pCex
->
iFrame
+
1
);
// output flop values (unaffected by the minimization)
if
(
(
vNamesIn
=
Abc_FrameReadCexCiNames
(
pAbc
))
!=
NULL
)
Vec_PtrForEachEntryStart
(
char
*
,
vNamesIn
,
pObjName
,
i
,
Abc_NtkPiNum
(
pNtk
)
)
IoCommandPrintLatchName
(
pFile
,
pNtk
,
NULL
,
pObjName
,
pCex
,
pCare
);
else
Abc_NtkForEachLatch
(
pNtk
,
pObj
,
i
)
{
char
*
pObjName
=
Abc_ObjName
(
Abc_ObjFanout0
(
pObj
));
int
ii
,
NameLen
=
strlen
(
pObjName
);
// check if there is a PI with a matching name
Abc_Obj_t
*
pObjPi
;
Abc_NtkForEachPi
(
pNtk
,
pObjPi
,
ii
)
if
(
!
strncmp
(
Abc_ObjName
(
pObjPi
),
pObjName
,
NameLen
)
&&
!
strncmp
(
Abc_ObjName
(
pObjPi
)
+
NameLen
,
"_init"
,
5
)
)
{
if
(
!
pCare
||
Abc_InfoHasBit
(
pCare
->
pData
,
pCare
->
nRegs
+
ii
)
)
fprintf
(
pFile
,
"%s@%d=%c
\n
"
,
pObjName
,
0
,
'0'
+
Abc_InfoHasBit
(
pCex
->
pData
,
pCare
->
nRegs
+
ii
)
);
break
;
}
if
(
ii
!=
Abc_NtkPiNum
(
pNtk
)
)
continue
;
if
(
!
strncmp
(
pObjName
,
"abc_reset_flop"
,
14
)
)
continue
;
fprintf
(
pFile
,
"%s@0=%c
\n
"
,
pObjName
,
'0'
+!
Abc_LatchIsInit0
(
pObj
)
);
}
IoCommandPrintLatchName
(
pFile
,
pNtk
,
pObj
,
Abc_ObjName
(
Abc_ObjFanout0
(
pObj
)),
pCex
,
pCare
);
// output PI values (while skipping the minimized ones)
for
(
f
=
0
;
f
<=
pCex
->
iFrame
;
f
++
)
Abc_NtkForEachPi
(
pNtk
,
pObj
,
i
)
...
...
src/base/main/main.h
View file @
4d8c72d0
...
...
@@ -127,6 +127,8 @@ extern ABC_DLL int Abc_FrameReadCexPiNum( Abc_Frame_t * p );
extern
ABC_DLL
int
Abc_FrameReadCexRegNum
(
Abc_Frame_t
*
p
);
extern
ABC_DLL
int
Abc_FrameReadCexPo
(
Abc_Frame_t
*
p
);
extern
ABC_DLL
int
Abc_FrameReadCexFrame
(
Abc_Frame_t
*
p
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_FrameReadCexCiNames
(
Abc_Frame_t
*
p
);
extern
ABC_DLL
void
Abc_FrameSetCexCiNames
(
Vec_Ptr_t
*
vNames
);
extern
ABC_DLL
void
Abc_FrameSetNtkStore
(
Abc_Ntk_t
*
pNtk
);
extern
ABC_DLL
void
Abc_FrameSetNtkStoreSize
(
int
nStored
);
...
...
src/base/main/mainFrame.c
View file @
4d8c72d0
...
...
@@ -83,6 +83,9 @@ int Abc_FrameReadCexPiNum( Abc_Frame_t * p ) { return s_GlobalFr
int
Abc_FrameReadCexRegNum
(
Abc_Frame_t
*
p
)
{
return
s_GlobalFrame
->
pCex
->
nRegs
;
}
int
Abc_FrameReadCexPo
(
Abc_Frame_t
*
p
)
{
return
s_GlobalFrame
->
pCex
->
iPo
;
}
int
Abc_FrameReadCexFrame
(
Abc_Frame_t
*
p
)
{
return
s_GlobalFrame
->
pCex
->
iFrame
;
}
Vec_Ptr_t
*
Abc_FrameReadCexCiNames
(
Abc_Frame_t
*
p
)
{
return
s_GlobalFrame
->
vCiNamesStore
;
}
void
Abc_FrameSetCexCiNames
(
Vec_Ptr_t
*
vNames
)
{
if
(
s_GlobalFrame
->
vCiNamesStore
)
Vec_PtrFreeFree
(
s_GlobalFrame
->
vCiNamesStore
);
s_GlobalFrame
->
vCiNamesStore
=
vNames
;
}
void
Abc_FrameInputNdr
(
Abc_Frame_t
*
pAbc
,
void
*
pData
)
{
Ndr_Delete
(
s_GlobalFrame
->
pNdr
);
s_GlobalFrame
->
pNdr
=
pData
;
}
void
*
Abc_FrameOutputNdr
(
Abc_Frame_t
*
pAbc
)
{
void
*
pData
=
s_GlobalFrame
->
pNdr
;
s_GlobalFrame
->
pNdr
=
NULL
;
return
pData
;
}
...
...
@@ -240,6 +243,7 @@ void Abc_FrameDeallocate( Abc_Frame_t * p )
Vec_WecFreeP
(
&
s_GlobalFrame
->
vJsonObjs
);
Ndr_Delete
(
s_GlobalFrame
->
pNdr
);
ABC_FREE
(
s_GlobalFrame
->
pNdrArray
);
Vec_PtrFreeFree
(
s_GlobalFrame
->
vCiNamesStore
);
Gia_ManStopP
(
&
p
->
pGiaMiniAig
);
Gia_ManStopP
(
&
p
->
pGiaMiniLut
);
...
...
src/base/main/mainInt.h
View file @
4d8c72d0
...
...
@@ -152,6 +152,7 @@ struct Abc_Frame_t_
int
*
pBoxes
;
void
*
pNdr
;
int
*
pNdrArray
;
Vec_Ptr_t
*
vCiNamesStore
;
// storage for CI names
Abc_Frame_Callback_BmcFrameDone_Func
pFuncOnFrameDone
;
};
...
...
src/base/wlc/wlcCom.c
View file @
4d8c72d0
...
...
@@ -1124,6 +1124,7 @@ int Abc_CommandBlast( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
1
,
"Finished dumping file
\"
pio_name_map.txt
\"
containing PI/PO name mapping.
\n
"
);
}
}
Abc_FrameSetCexCiNames
(
Vec_PtrDupStr
(
pNew
->
vNamesIn
)
);
Abc_FrameUpdateGia
(
pAbc
,
pNew
);
return
0
;
usage:
...
...
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