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
63dab645
Commit
63dab645
authored
Jul 10, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replacing printf() by Abc_Print().
parent
448eec77
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
42 deletions
+42
-42
src/aig/gia/giaAbsGla.c
+31
-31
src/aig/gia/giaAbsVta.c
+10
-10
src/base/main/main.c
+1
-1
No files found.
src/aig/gia/giaAbsGla.c
View file @
63dab645
...
...
@@ -142,21 +142,21 @@ static inline void Gla_ObjClearRef( Rfn_Obj_t * p ) {
***********************************************************************/
static
inline
void
Abc_PrintInt
(
int
i
)
{
printf
(
" "
);
Abc_Print
(
1
,
" "
);
if
(
i
>
-
1000
&&
i
<
1000
)
printf
(
" %4d"
,
i
);
Abc_Print
(
1
,
" %4d"
,
i
);
else
if
(
i
>
-
10000
&&
i
<
10000
)
printf
(
"%4.2fk"
,
(
float
)
i
/
1000
);
Abc_Print
(
1
,
"%4.2fk"
,
(
float
)
i
/
1000
);
else
if
(
i
>
-
100000
&&
i
<
100000
)
printf
(
"%4.1fk"
,
(
float
)
i
/
1000
);
Abc_Print
(
1
,
"%4.1fk"
,
(
float
)
i
/
1000
);
else
if
(
i
>
-
1000000
&&
i
<
1000000
)
printf
(
"%4.0fk"
,
(
float
)
i
/
1000
);
Abc_Print
(
1
,
"%4.0fk"
,
(
float
)
i
/
1000
);
else
if
(
i
>
-
10000000
&&
i
<
10000000
)
printf
(
"%4.2fm"
,
(
float
)
i
/
1000000
);
Abc_Print
(
1
,
"%4.2fm"
,
(
float
)
i
/
1000000
);
else
if
(
i
>
-
100000000
&&
i
<
100000000
)
printf
(
"%4.1fm"
,
(
float
)
i
/
1000000
);
Abc_Print
(
1
,
"%4.1fm"
,
(
float
)
i
/
1000000
);
else
if
(
i
>
-
1000000000
&&
i
<
1000000000
)
printf
(
"%4.0fm"
,
(
float
)
i
/
1000000
);
Abc_Print
(
1
,
"%4.0fm"
,
(
float
)
i
/
1000000
);
}
/**Function*************************************************************
...
...
@@ -192,14 +192,14 @@ Abc_Cex_t * Gia_ManCexRemap( Gia_Man_t * p, Abc_Cex_t * pCexAbs, Vec_Int_t * vPi
// verify the counter example
if
(
!
Gia_ManVerifyCex
(
p
,
pCex
,
0
)
)
{
printf
(
"Gia_ManCexRemap(): Counter-example is invalid.
\n
"
);
Abc_Print
(
1
,
"Gia_ManCexRemap(): Counter-example is invalid.
\n
"
);
Abc_CexFree
(
pCex
);
pCex
=
NULL
;
}
else
{
printf
(
"Counter-example verification is successful.
\n
"
);
printf
(
"Output %d was asserted in frame %d (use
\"
write_counter
\"
to dump a witness).
\n
"
,
pCex
->
iPo
,
pCex
->
iFrame
);
Abc_Print
(
1
,
"Counter-example verification is successful.
\n
"
);
Abc_Print
(
1
,
"Output %d was asserted in frame %d (use
\"
write_counter
\"
to dump a witness).
\n
"
,
pCex
->
iPo
,
pCex
->
iFrame
);
}
return
pCex
;
}
...
...
@@ -230,7 +230,7 @@ int Gia_ManGlaRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int fMinCut, int fVerbose
int
nOnes
=
0
,
Counter
=
0
;
if
(
p
->
vGateClasses
==
NULL
)
{
printf
(
"Gia_ManGlaRefine(): Abstraction gate map is missing.
\n
"
);
Abc_Print
(
1
,
"Gia_ManGlaRefine(): Abstraction gate map is missing.
\n
"
);
return
-
1
;
}
// derive abstraction
...
...
@@ -239,18 +239,18 @@ int Gia_ManGlaRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int fMinCut, int fVerbose
pAbs
=
Gia_ManDupAbsGates
(
p
,
p
->
vGateClasses
);
if
(
Gia_ManPiNum
(
pAbs
)
!=
pCex
->
nPis
)
{
printf
(
"Gia_ManGlaRefine(): The PI counts in GLA and in CEX do not match.
\n
"
);
Abc_Print
(
1
,
"Gia_ManGlaRefine(): The PI counts in GLA and in CEX do not match.
\n
"
);
Gia_ManStop
(
pAbs
);
return
-
1
;
}
if
(
!
Gia_ManVerifyCex
(
pAbs
,
pCex
,
0
)
)
{
printf
(
"Gia_ManGlaRefine(): The initial counter-example is invalid.
\n
"
);
Abc_Print
(
1
,
"Gia_ManGlaRefine(): The initial counter-example is invalid.
\n
"
);
Gia_ManStop
(
pAbs
);
return
-
1
;
}
// else
//
printf(
"Gia_ManGlaRefine(): The initial counter-example is correct.\n" );
//
Abc_Print( 1,
"Gia_ManGlaRefine(): The initial counter-example is correct.\n" );
// get inputs
Gia_ManGlaCollect
(
p
,
p
->
vGateClasses
,
&
vPis
,
&
vPPis
,
NULL
,
NULL
);
assert
(
Vec_IntSize
(
vPis
)
+
Vec_IntSize
(
vPPis
)
==
Gia_ManPiNum
(
pAbs
)
);
...
...
@@ -287,10 +287,10 @@ int Gia_ManGlaRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int fMinCut, int fVerbose
if
(
Gia_ObjTerSimGet1
(
pObj
)
)
{
pCexNew
=
Gia_ManCexRemap
(
p
,
pCex
,
vPis
);
printf
(
"Procedure &gla_refine found a real counter-example in frame %d.
\n
"
,
pCexNew
->
iFrame
);
Abc_Print
(
1
,
"Procedure &gla_refine found a real counter-example in frame %d.
\n
"
,
pCexNew
->
iFrame
);
}
// else
//
printf(
"CEX is not real.\n" );
//
Abc_Print( 1,
"CEX is not real.\n" );
Gia_ManForEachObj
(
pAbs
,
pObj
,
i
)
Gia_ObjTerSimSetC
(
pObj
);
if
(
pCexNew
==
NULL
)
...
...
@@ -303,7 +303,7 @@ int Gia_ManGlaRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int fMinCut, int fVerbose
}
if
(
fVerbose
)
{
printf
(
"Additional objects = %d. "
,
Vec_IntSize
(
vPPis
)
);
Abc_Print
(
1
,
"Additional objects = %d. "
,
Vec_IntSize
(
vPPis
)
);
Abc_PrintTime
(
1
,
"Time"
,
clock
()
-
clk
);
}
}
...
...
@@ -315,7 +315,7 @@ int Gia_ManGlaRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int fMinCut, int fVerbose
pCare
=
Saig_ManCbaFindCexCareBits
(
pAig
,
pCex
,
Vec_IntSize
(
vPis
),
fVerbose
);
Aig_ManStop
(
pAig
);
if
(
pCare
==
NULL
)
printf
(
"Counter-example minimization has failed.
\n
"
);
Abc_Print
(
1
,
"Counter-example minimization has failed.
\n
"
);
// add new objects to the map
iObjId
=
-
1
;
for
(
f
=
0
;
f
<=
pCare
->
iFrame
;
f
++
)
...
...
@@ -330,21 +330,21 @@ int Gia_ManGlaRefine( Gia_Man_t * p, Abc_Cex_t * pCex, int fMinCut, int fVerbose
continue
;
assert
(
Vec_IntEntry
(
p
->
vGateClasses
,
iObjId
)
==
0
);
Vec_IntWriteEntry
(
p
->
vGateClasses
,
iObjId
,
1
);
//
printf(
"Adding object %d.\n", iObjId );
//
Abc_Print( 1,
"Adding object %d.\n", iObjId );
// Gia_ObjPrint( p, Gia_ManObj(p, iObjId) );
Counter
++
;
}
Abc_CexFree
(
pCare
);
if
(
fVerbose
)
{
printf
(
"Essential bits = %d. Additional objects = %d. "
,
nOnes
,
Counter
);
Abc_Print
(
1
,
"Essential bits = %d. Additional objects = %d. "
,
nOnes
,
Counter
);
Abc_PrintTime
(
1
,
"Time"
,
clock
()
-
clk
);
}
// consider the case of SAT
if
(
iObjId
==
-
1
)
{
pCexNew
=
Gia_ManCexRemap
(
p
,
pCex
,
vPis
);
printf
(
"Procedure &gla_refine found a real counter-example in frame %d.
\n
"
,
pCexNew
->
iFrame
);
Abc_Print
(
1
,
"Procedure &gla_refine found a real counter-example in frame %d.
\n
"
,
pCexNew
->
iFrame
);
}
}
Vec_IntFree
(
vPis
);
...
...
@@ -663,7 +663,7 @@ void Gla_ManVerifyUsingTerSim( Gla_Man_t * p, Vec_Int_t * vPis, Vec_Int_t * vPPi
}
pObj
=
Gia_ManPo
(
p
->
pGia
,
0
);
if
(
!
Gia_ObjTerSimGet1
(
pObj
)
)
printf
(
"
\n
Refinement verification has failed!!!
\n
"
);
Abc_Print
(
1
,
"
\n
Refinement verification has failed!!!
\n
"
);
// clear
Gia_ObjTerSimSetC
(
Gia_ManConst0
(
p
->
pGia
)
);
Gia_ManForEachObjVec
(
vPis
,
p
->
pGia
,
pObj
,
i
)
...
...
@@ -709,19 +709,19 @@ Vec_Int_t * Gla_ManRefinement( Gla_Man_t * p )
// check how many pseudo PIs have variables
Gla_ManForEachObjAbsVec( vPis, p, pGla, i )
{
printf(
" %5d : ", Gla_ObjId(p, pGla) );
Abc_Print( 1,
" %5d : ", Gla_ObjId(p, pGla) );
for ( f = 0; f <= p->pPars->iFrame; f++ )
printf(
"%d", Gla_ManCheckVar(p, Gla_ObjId(p, pGla), f) );
printf(
"\n" );
Abc_Print( 1,
"%d", Gla_ManCheckVar(p, Gla_ObjId(p, pGla), f) );
Abc_Print( 1,
"\n" );
}
// check how many pseudo PIs have variables
Gla_ManForEachObjAbsVec( vPPis, p, pGla, i )
{
printf(
"%5d : ", Gla_ObjId(p, pGla) );
Abc_Print( 1,
"%5d : ", Gla_ObjId(p, pGla) );
for ( f = 0; f <= p->pPars->iFrame; f++ )
printf(
"%d", Gla_ManCheckVar(p, Gla_ObjId(p, pGla), f) );
printf(
"\n" );
Abc_Print( 1,
"%d", Gla_ManCheckVar(p, Gla_ObjId(p, pGla), f) );
Abc_Print( 1,
"\n" );
}
*/
// propagate values
...
...
@@ -785,7 +785,7 @@ Vec_Int_t * Gla_ManRefinement( Gla_Man_t * p )
Gla_ManCheckVar
(
p
,
p
->
pObj2Obj
[
Gia_ObjId
(
p
->
pGia
,
pObj
)],
f
)
&&
(
int
)
pRef
->
Value
!=
Gla_ObjSatValue
(
p
,
Gia_ObjId
(
p
->
pGia
,
pObj
),
f
)
)
{
printf
(
"Object has value mismatch "
);
Abc_Print
(
1
,
"Object has value mismatch "
);
Gia_ObjPrint
(
p
->
pGia
,
pObj
);
}
...
...
@@ -816,7 +816,7 @@ Vec_Int_t * Gla_ManRefinement( Gla_Man_t * p )
pObj
=
Gia_ManPo
(
p
->
pGia
,
0
);
pRef
=
Gla_ObjRef
(
p
,
pObj
,
p
->
pPars
->
iFrame
);
if
(
pRef
->
Value
!=
1
)
printf
(
"
\n
Counter-example verification has failed!!!
\n
"
);
Abc_Print
(
1
,
"
\n
Counter-example verification has failed!!!
\n
"
);
// check the CEX
if
(
pRef
->
Prio
==
0
)
...
...
src/aig/gia/giaAbsVta.c
View file @
63dab645
...
...
@@ -148,21 +148,21 @@ extern void Vga_ManAddClausesOne( Vta_Man_t * p, int iObj, int iFrame );
***********************************************************************/
static
inline
void
Abc_PrintInt
(
int
i
)
{
printf
(
" "
);
Abc_Print
(
1
,
" "
);
if
(
i
>
-
1000
&&
i
<
1000
)
printf
(
" %4d"
,
i
);
Abc_Print
(
1
,
" %4d"
,
i
);
else
if
(
i
>
-
10000
&&
i
<
10000
)
printf
(
"%4.2fk"
,
(
float
)
i
/
1000
);
Abc_Print
(
1
,
"%4.2fk"
,
(
float
)
i
/
1000
);
else
if
(
i
>
-
100000
&&
i
<
100000
)
printf
(
"%4.1fk"
,
(
float
)
i
/
1000
);
Abc_Print
(
1
,
"%4.1fk"
,
(
float
)
i
/
1000
);
else
if
(
i
>
-
1000000
&&
i
<
1000000
)
printf
(
"%4.0fk"
,
(
float
)
i
/
1000
);
Abc_Print
(
1
,
"%4.0fk"
,
(
float
)
i
/
1000
);
else
if
(
i
>
-
10000000
&&
i
<
10000000
)
printf
(
"%4.2fm"
,
(
float
)
i
/
1000000
);
Abc_Print
(
1
,
"%4.2fm"
,
(
float
)
i
/
1000000
);
else
if
(
i
>
-
100000000
&&
i
<
100000000
)
printf
(
"%4.1fm"
,
(
float
)
i
/
1000000
);
Abc_Print
(
1
,
"%4.1fm"
,
(
float
)
i
/
1000000
);
else
if
(
i
>
-
1000000000
&&
i
<
1000000000
)
printf
(
"%4.0fm"
,
(
float
)
i
/
1000000
);
Abc_Print
(
1
,
"%4.0fm"
,
(
float
)
i
/
1000000
);
}
/**Function*************************************************************
...
...
@@ -621,8 +621,8 @@ void Vta_ManProfileAddition( Vta_Man_t * p, Vec_Int_t * vTermsToAdd )
Vta_ManForEachObjObjVec
(
vTermsToAdd
,
p
,
pThis
,
pObj
,
i
)
pCounters
[
pThis
->
iFrame
]
++
;
for
(
i
=
0
;
i
<=
p
->
pPars
->
iFrame
;
i
++
)
printf
(
"%2d"
,
pCounters
[
i
]
);
printf
(
"***
\n
"
);
Abc_Print
(
1
,
"%2d"
,
pCounters
[
i
]
);
Abc_Print
(
1
,
"***
\n
"
);
}
/**Function*************************************************************
...
...
src/base/main/main.c
View file @
63dab645
...
...
@@ -219,7 +219,7 @@ int Abc_RealMain( int argc, char * argv[] )
pAbc
->
pGia
=
Gia_ManFromBridge
(
stdin
,
NULL
);
}
else
if
(
fBatch
&&
sCommandUsr
[
0
]
)
printf
(
"ABC command line:
\"
%s
\"
.
\n
"
,
sCommandUsr
);
Abc_Print
(
1
,
"ABC command line:
\"
%s
\"
.
\n
"
,
sCommandUsr
);
if
(
fBatch
)
{
...
...
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