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
d05f89d9
Commit
d05f89d9
authored
Jan 16, 2019
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing the problem with outputting word-level CEXes.
parent
7f778ff8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
2 deletions
+48
-2
src/base/io/io.c
+24
-1
src/base/wlc/wlcBlast.c
+24
-1
No files found.
src/base/io/io.c
View file @
d05f89d9
...
@@ -2446,12 +2446,35 @@ int IoCommandWriteCex( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -2446,12 +2446,35 @@ int IoCommandWriteCex( Abc_Frame_t * pAbc, int argc, char **argv )
fprintf
(
pFile
,
"# COUNTEREXAMPLE LENGTH: %u
\n
"
,
pCex
->
iFrame
+
1
);
fprintf
(
pFile
,
"# COUNTEREXAMPLE LENGTH: %u
\n
"
,
pCex
->
iFrame
+
1
);
// output flop values (unaffected by the minimization)
// output flop values (unaffected by the minimization)
Abc_NtkForEachLatch
(
pNtk
,
pObj
,
i
)
Abc_NtkForEachLatch
(
pNtk
,
pObj
,
i
)
fprintf
(
pFile
,
"%s@0=%c
\n
"
,
Abc_ObjName
(
Abc_ObjFanout0
(
pObj
)),
'0'
+!
Abc_LatchIsInit0
(
pObj
)
);
{
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
)
);
}
// output PI values (while skipping the minimized ones)
// output PI values (while skipping the minimized ones)
for
(
f
=
0
;
f
<=
pCex
->
iFrame
;
f
++
)
for
(
f
=
0
;
f
<=
pCex
->
iFrame
;
f
++
)
Abc_NtkForEachPi
(
pNtk
,
pObj
,
i
)
Abc_NtkForEachPi
(
pNtk
,
pObj
,
i
)
{
// skip names with "_init" in the end
int
NameLen
=
strlen
(
Abc_ObjName
(
pObj
));
if
(
NameLen
>
5
&&
!
strncmp
(
Abc_ObjName
(
pObj
)
+
NameLen
-
5
,
"_init"
,
5
)
)
continue
;
if
(
!
pCare
||
Abc_InfoHasBit
(
pCare
->
pData
,
pCare
->
nRegs
+
pCare
->
nPis
*
f
+
i
)
)
if
(
!
pCare
||
Abc_InfoHasBit
(
pCare
->
pData
,
pCare
->
nRegs
+
pCare
->
nPis
*
f
+
i
)
)
fprintf
(
pFile
,
"%s@%d=%c
\n
"
,
Abc_ObjName
(
pObj
),
f
,
'0'
+
Abc_InfoHasBit
(
pCex
->
pData
,
pCex
->
nRegs
+
pCex
->
nPis
*
f
+
i
)
);
fprintf
(
pFile
,
"%s@%d=%c
\n
"
,
Abc_ObjName
(
pObj
),
f
,
'0'
+
Abc_InfoHasBit
(
pCex
->
pData
,
pCex
->
nRegs
+
pCex
->
nPis
*
f
+
i
)
);
}
Abc_CexFreeP
(
&
pCare
);
Abc_CexFreeP
(
&
pCare
);
}
}
else
else
...
...
src/base/wlc/wlcBlast.c
View file @
d05f89d9
...
@@ -1150,6 +1150,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
...
@@ -1150,6 +1150,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
int
i
,
k
,
b
,
iFanin
,
iLit
,
nAndPrev
,
*
pFans0
,
*
pFans1
,
*
pFans2
,
*
pFans3
;
int
i
,
k
,
b
,
iFanin
,
iLit
,
nAndPrev
,
*
pFans0
,
*
pFans1
,
*
pFans2
,
*
pFans3
;
int
nFFins
=
0
,
nFFouts
=
0
,
curPi
=
0
,
curPo
=
0
,
nFf2Regs
=
0
;
int
nFFins
=
0
,
nFFouts
=
0
,
curPi
=
0
,
curPo
=
0
,
nFf2Regs
=
0
;
int
nBitCis
=
0
,
nBitCos
=
0
,
fAdded
=
0
;
int
nBitCis
=
0
,
nBitCos
=
0
,
fAdded
=
0
;
int
iFirstAddPi
=
-
1
;
// remembers the first additional PI that stands for DC-flop output
Wlc_BstPar_t
Par
,
*
pPar
=
&
Par
;
Wlc_BstPar_t
Par
,
*
pPar
=
&
Par
;
Wlc_BstParDefault
(
pPar
);
Wlc_BstParDefault
(
pPar
);
pPar
=
pParIn
?
pParIn
:
pPar
;
pPar
=
pParIn
?
pParIn
:
pPar
;
...
@@ -2122,9 +2123,14 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
...
@@ -2122,9 +2123,14 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
{
{
char
Buffer
[
100
];
char
Buffer
[
100
];
sprintf
(
Buffer
,
"%s%d"
,
"init"
,
i
);
sprintf
(
Buffer
,
"%s%d"
,
"init"
,
i
);
Vec_PtrPush
(
pNew
->
vNamesIn
,
Abc_UtilStrsav
(
Buffer
)
);
//Vec_PtrPush( pNew->vNamesIn, Abc_UtilStrsav(Buffer) );
// save NULL at this time - to be overwritten later
//printf( "Adding NULL in position %d\n", Vec_PtrSize(pNew->vNamesIn) );
Vec_PtrPush
(
pNew
->
vNamesIn
,
NULL
);
fAdded
=
1
;
fAdded
=
1
;
}
}
// remember the place in the array where the first real flop is
iFirstAddPi
=
Vec_PtrSize
(
pNew
->
vNamesIn
);
}
}
Wlc_NtkForEachCi
(
p
,
pObj
,
i
)
Wlc_NtkForEachCi
(
p
,
pObj
,
i
)
if
(
!
Wlc_ObjIsPi
(
pObj
)
)
if
(
!
Wlc_ObjIsPi
(
pObj
)
)
...
@@ -2141,6 +2147,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
...
@@ -2141,6 +2147,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
Vec_PtrPush
(
pNew
->
vNamesIn
,
Abc_UtilStrsav
(
Buffer
)
);
Vec_PtrPush
(
pNew
->
vNamesIn
,
Abc_UtilStrsav
(
Buffer
)
);
}
}
}
}
/*
Wlc_NtkForEachFf2( p, pObj, i )
Wlc_NtkForEachFf2( p, pObj, i )
{
{
char * pName = Wlc_ObjName(p, Wlc_ObjId(p, pObj));
char * pName = Wlc_ObjName(p, Wlc_ObjId(p, pObj));
...
@@ -2159,6 +2166,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
...
@@ -2159,6 +2166,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
Vec_PtrPush( pNew->vNamesIn, Abc_UtilStrsav(Buffer) );
Vec_PtrPush( pNew->vNamesIn, Abc_UtilStrsav(Buffer) );
}
}
}
}
*/
Wlc_NtkForEachFf2
(
p
,
pObj
,
i
)
Wlc_NtkForEachFf2
(
p
,
pObj
,
i
)
{
{
char
*
pName
=
Wlc_ObjName
(
p
,
Wlc_ObjId
(
p
,
pObj
));
char
*
pName
=
Wlc_ObjName
(
p
,
Wlc_ObjId
(
p
,
pObj
));
...
@@ -2191,6 +2199,21 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
...
@@ -2191,6 +2199,21 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Wlc_BstPar_t * pParIn )
}
}
}
}
assert
(
Vec_PtrSize
(
pNew
->
vNamesIn
)
==
Gia_ManCiNum
(
pNew
)
);
assert
(
Vec_PtrSize
(
pNew
->
vNamesIn
)
==
Gia_ManCiNum
(
pNew
)
);
// finish creating names of additional primary inputs
if
(
p
->
pInits
)
{
int
Length
=
strlen
(
p
->
pInits
);
assert
(
iFirstAddPi
>=
0
);
for
(
i
=
0
;
i
<
Length
;
i
++
)
if
(
p
->
pInits
[
i
]
==
'x'
||
p
->
pInits
[
i
]
==
'X'
)
{
char
Buffer
[
1000
];
sprintf
(
Buffer
,
"%s_init"
,
(
char
*
)
Vec_PtrEntry
(
pNew
->
vNamesIn
,
iFirstAddPi
+
i
)
);
assert
(
Vec_PtrEntry
(
pNew
->
vNamesIn
,
iFirstAddPi
-
Length
+
i
)
==
NULL
);
Vec_PtrWriteEntry
(
pNew
->
vNamesIn
,
iFirstAddPi
-
Length
+
i
,
Abc_UtilStrsav
(
Buffer
)
);
//printf( "Replacing NULL in position %d\n", iFirstAddPi-Length+i );
}
}
// create output names
// create output names
pNew
->
vNamesOut
=
Vec_PtrAlloc
(
Gia_ManCoNum
(
pNew
)
);
pNew
->
vNamesOut
=
Vec_PtrAlloc
(
Gia_ManCoNum
(
pNew
)
);
Wlc_NtkForEachFf2
(
p
,
pObj
,
i
)
Wlc_NtkForEachFf2
(
p
,
pObj
,
i
)
...
...
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