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
9195192f
Commit
9195192f
authored
Feb 27, 2017
by
Yen-Sheng Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
%pdra -L: now applies to all types
parent
bb3eacf4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
33 deletions
+105
-33
src/base/wlc/wlc.h
+1
-1
src/base/wlc/wlcAbs.c
+100
-28
src/base/wlc/wlcCom.c
+3
-3
src/base/wlc/wlcNtk.c
+1
-1
No files found.
src/base/wlc/wlc.h
View file @
9195192f
...
...
@@ -169,7 +169,7 @@ struct Wlc_Par_t_
int
nBitsMux
;
// MUX bit-width
int
nBitsFlop
;
// flop bit-width
int
nIterMax
;
// the max number of iterations
int
n
MuxLimit
;
// the max number of muxe
s
int
n
Limit
;
// the max number of signal
s
int
fXorOutput
;
// XOR outputs of word-level miter
int
fCheckClauses
;
// Check clauses in the reloaded trace
int
fPushClauses
;
// Push clauses in the reloaded trace
...
...
src/base/wlc/wlcAbs.c
View file @
9195192f
...
...
@@ -465,21 +465,45 @@ static int Wlc_NtkUpdateBlacks( Wlc_Ntk_t * p, Wlc_Par_t * pPars, Vec_Int_t ** p
return
0
;
}
static
Vec_Bit_t
*
Wlc_NtkMark
Muxes
(
Wlc_Ntk_t
*
p
,
Wlc_Par_t
*
pPars
)
static
Vec_Bit_t
*
Wlc_NtkMark
Limit
(
Wlc_Ntk_t
*
p
,
Wlc_Par_t
*
pPars
)
{
Vec_Bit_t
*
vMuxMark
=
NULL
;
Vec_Bit_t
*
vMarks
=
NULL
;
Vec_Ptr_t
*
vAdds
=
Vec_PtrAlloc
(
1000
);
Vec_Ptr_t
*
vMuxes
=
Vec_PtrAlloc
(
1000
);
Vec_Ptr_t
*
vMults
=
Vec_PtrAlloc
(
1000
);
Vec_Ptr_t
*
vFlops
=
Vec_PtrAlloc
(
1000
);
Wlc_Obj_t
*
pObj
;
int
i
;
Int_Pair_t
*
pPair
;
if
(
pPars
->
n
Mux
Limit
==
ABC_INFINITY
)
if
(
pPars
->
nLimit
==
ABC_INFINITY
)
return
NULL
;
vM
uxMark
=
Vec_BitStart
(
Wlc_NtkObjNumMax
(
p
)
);
vM
arks
=
Vec_BitStart
(
Wlc_NtkObjNumMax
(
p
)
);
Wlc_NtkForEachObj
(
p
,
pObj
,
i
)
{
if
(
pObj
->
Type
==
WLC_OBJ_MUX
)
{
if
(
pObj
->
Type
==
WLC_OBJ_ARI_ADD
||
pObj
->
Type
==
WLC_OBJ_ARI_SUB
||
pObj
->
Type
==
WLC_OBJ_ARI_MINUS
)
{
if
(
Wlc_ObjRange
(
pObj
)
>=
pPars
->
nBitsAdd
)
{
pPair
=
ABC_ALLOC
(
Int_Pair_t
,
1
);
pPair
->
first
=
i
;
pPair
->
second
=
Wlc_ObjRange
(
pObj
);
Vec_PtrPush
(
vAdds
,
pPair
);
}
}
else
if
(
pObj
->
Type
==
WLC_OBJ_ARI_MULTI
||
pObj
->
Type
==
WLC_OBJ_ARI_DIVIDE
||
pObj
->
Type
==
WLC_OBJ_ARI_REM
||
pObj
->
Type
==
WLC_OBJ_ARI_MODULUS
)
{
if
(
Wlc_ObjRange
(
pObj
)
>=
pPars
->
nBitsMul
)
{
pPair
=
ABC_ALLOC
(
Int_Pair_t
,
1
);
pPair
->
first
=
i
;
pPair
->
second
=
Wlc_ObjRange
(
pObj
);
Vec_PtrPush
(
vMults
,
pPair
);
}
}
else
if
(
pObj
->
Type
==
WLC_OBJ_MUX
)
{
if
(
Wlc_ObjRange
(
pObj
)
>=
pPars
->
nBitsMux
)
{
pPair
=
ABC_ALLOC
(
Int_Pair_t
,
1
);
...
...
@@ -488,60 +512,103 @@ static Vec_Bit_t * Wlc_NtkMarkMuxes( Wlc_Ntk_t * p, Wlc_Par_t * pPars )
Vec_PtrPush
(
vMuxes
,
pPair
);
}
}
else
if
(
Wlc_ObjIsCi
(
pObj
)
&&
!
Wlc_ObjIsPi
(
pObj
)
)
{
if
(
Wlc_ObjRange
(
pObj
)
>=
pPars
->
nBitsFlop
)
{
pPair
=
ABC_ALLOC
(
Int_Pair_t
,
1
);
pPair
->
first
=
i
;
pPair
->
second
=
Wlc_ObjRange
(
pObj
);
Vec_PtrPush
(
vFlops
,
pPair
);
}
}
}
Vec_PtrSort
(
vAdds
,
(
int
(
*
)(
void
))
IntPairPtrCompare
)
;
Vec_PtrSort
(
vMults
,
(
int
(
*
)(
void
))
IntPairPtrCompare
)
;
Vec_PtrSort
(
vMuxes
,
(
int
(
*
)(
void
))
IntPairPtrCompare
)
;
Vec_PtrSort
(
vFlops
,
(
int
(
*
)(
void
))
IntPairPtrCompare
)
;
Vec_PtrForEachEntry
(
Int_Pair_t
*
,
v
Muxe
s
,
pPair
,
i
)
Vec_PtrForEachEntry
(
Int_Pair_t
*
,
v
Add
s
,
pPair
,
i
)
{
if
(
i
>=
pPars
->
nMuxLimit
)
break
;
Vec_BitWriteEntry
(
vMuxMark
,
pPair
->
first
,
1
);
if
(
i
>=
pPars
->
nLimit
)
break
;
Vec_BitWriteEntry
(
vMarks
,
pPair
->
first
,
1
);
}
if
(
i
&&
pPars
->
fVerbose
)
Abc_Print
(
1
,
"%%PDRA: %d-th ADD has width = %d
\n
"
,
i
,
pPair
->
second
);
if
(
i
&&
pPars
->
fVerbose
)
Abc_Print
(
1
,
"%%PDRA: %d-th MUX has width = %d
\n
"
,
i
,
pPair
->
second
);
Vec_PtrForEachEntry
(
Int_Pair_t
*
,
vMults
,
pPair
,
i
)
{
if
(
i
>=
pPars
->
nLimit
)
break
;
Vec_BitWriteEntry
(
vMarks
,
pPair
->
first
,
1
);
}
if
(
i
&&
pPars
->
fVerbose
)
Abc_Print
(
1
,
"%%PDRA: %d-th MUL has width = %d
\n
"
,
i
,
pPair
->
second
);
Vec_PtrForEachEntry
(
Int_Pair_t
*
,
vMuxes
,
pPair
,
i
)
ABC_FREE
(
pPair
);
{
if
(
i
>=
pPars
->
nLimit
)
break
;
Vec_BitWriteEntry
(
vMarks
,
pPair
->
first
,
1
);
}
if
(
i
&&
pPars
->
fVerbose
)
Abc_Print
(
1
,
"%%PDRA: %d-th MUX has width = %d
\n
"
,
i
,
pPair
->
second
);
Vec_PtrForEachEntry
(
Int_Pair_t
*
,
vFlops
,
pPair
,
i
)
{
if
(
i
>=
pPars
->
nLimit
)
break
;
Vec_BitWriteEntry
(
vMarks
,
pPair
->
first
,
1
);
}
if
(
i
&&
pPars
->
fVerbose
)
Abc_Print
(
1
,
"%%PDRA: %d-th FF has width = %d
\n
"
,
i
,
pPair
->
second
);
Vec_PtrForEachEntry
(
Int_Pair_t
*
,
vAdds
,
pPair
,
i
)
ABC_FREE
(
pPair
);
Vec_PtrForEachEntry
(
Int_Pair_t
*
,
vMults
,
pPair
,
i
)
ABC_FREE
(
pPair
);
Vec_PtrForEachEntry
(
Int_Pair_t
*
,
vMuxes
,
pPair
,
i
)
ABC_FREE
(
pPair
);
Vec_PtrForEachEntry
(
Int_Pair_t
*
,
vFlops
,
pPair
,
i
)
ABC_FREE
(
pPair
);
Vec_PtrFree
(
vAdds
);
Vec_PtrFree
(
vMults
);
Vec_PtrFree
(
vMuxes
);
Vec_PtrFree
(
vFlops
);
return
vM
uxMark
;
return
vM
arks
;
}
static
Vec_Int_t
*
Wlc_NtkGetBlacks
(
Wlc_Ntk_t
*
p
,
Wlc_Par_t
*
pPars
,
Vec_Bit_t
*
vUnmark
)
static
Vec_Int_t
*
Wlc_NtkGetBlacks
(
Wlc_Ntk_t
*
p
,
Wlc_Par_t
*
pPars
)
{
Vec_Int_t
*
vBlacks
=
Vec_IntAlloc
(
100
)
;
Wlc_Obj_t
*
pObj
;
int
i
,
Count
[
4
]
=
{
0
};
Vec_Bit_t
*
vM
uxMark
=
NULL
;
Vec_Bit_t
*
vM
arks
=
NULL
;
vM
uxMark
=
Wlc_NtkMarkMuxes
(
p
,
pPars
)
;
vM
arks
=
Wlc_NtkMarkLimit
(
p
,
pPars
)
;
Wlc_NtkForEachObj
(
p
,
pObj
,
i
)
{
if
(
vUnmark
&&
Vec_BitEntry
(
vUnmark
,
i
)
)
// not allow this object to be abstracted away
continue
;
if
(
pObj
->
Type
==
WLC_OBJ_ARI_ADD
||
pObj
->
Type
==
WLC_OBJ_ARI_SUB
||
pObj
->
Type
==
WLC_OBJ_ARI_MINUS
)
{
if
(
Wlc_ObjRange
(
pObj
)
>=
pPars
->
nBitsAdd
)
Vec_IntPushUniqueOrder
(
vBlacks
,
Wlc_ObjId
(
p
,
pObj
)
),
Count
[
0
]
++
;
{
if
(
vMarks
==
NULL
)
Vec_IntPushUniqueOrder
(
vBlacks
,
Wlc_ObjId
(
p
,
pObj
)
),
Count
[
0
]
++
;
else
if
(
Vec_BitEntry
(
vMarks
,
i
)
)
Vec_IntPushUniqueOrder
(
vBlacks
,
Wlc_ObjId
(
p
,
pObj
)
),
Count
[
0
]
++
;
}
continue
;
}
if
(
pObj
->
Type
==
WLC_OBJ_ARI_MULTI
||
pObj
->
Type
==
WLC_OBJ_ARI_DIVIDE
||
pObj
->
Type
==
WLC_OBJ_ARI_REM
||
pObj
->
Type
==
WLC_OBJ_ARI_MODULUS
)
{
if
(
Wlc_ObjRange
(
pObj
)
>=
pPars
->
nBitsMul
)
Vec_IntPushUniqueOrder
(
vBlacks
,
Wlc_ObjId
(
p
,
pObj
)
),
Count
[
1
]
++
;
{
if
(
vMarks
==
NULL
)
Vec_IntPushUniqueOrder
(
vBlacks
,
Wlc_ObjId
(
p
,
pObj
)
),
Count
[
1
]
++
;
else
if
(
Vec_BitEntry
(
vMarks
,
i
)
)
Vec_IntPushUniqueOrder
(
vBlacks
,
Wlc_ObjId
(
p
,
pObj
)
),
Count
[
1
]
++
;
}
continue
;
}
if
(
pObj
->
Type
==
WLC_OBJ_MUX
)
{
if
(
Wlc_ObjRange
(
pObj
)
>=
pPars
->
nBitsMux
)
{
if
(
vM
uxMark
==
NULL
)
if
(
vM
arks
==
NULL
)
Vec_IntPushUniqueOrder
(
vBlacks
,
Wlc_ObjId
(
p
,
pObj
)
),
Count
[
2
]
++
;
else
if
(
Vec_BitEntry
(
vM
uxMark
,
i
)
)
else
if
(
Vec_BitEntry
(
vM
arks
,
i
)
)
Vec_IntPushUniqueOrder
(
vBlacks
,
Wlc_ObjId
(
p
,
pObj
)
),
Count
[
2
]
++
;
}
continue
;
...
...
@@ -549,12 +616,17 @@ static Vec_Int_t * Wlc_NtkGetBlacks( Wlc_Ntk_t * p, Wlc_Par_t * pPars, Vec_Bit_t
if
(
Wlc_ObjIsCi
(
pObj
)
&&
!
Wlc_ObjIsPi
(
pObj
)
)
{
if
(
Wlc_ObjRange
(
pObj
)
>=
pPars
->
nBitsFlop
)
Vec_IntPushUniqueOrder
(
vBlacks
,
Wlc_ObjId
(
p
,
Wlc_ObjFo2Fi
(
p
,
pObj
)
)
),
Count
[
3
]
++
;
{
if
(
vMarks
==
NULL
)
Vec_IntPushUniqueOrder
(
vBlacks
,
Wlc_ObjId
(
p
,
Wlc_ObjFo2Fi
(
p
,
pObj
)
)
),
Count
[
3
]
++
;
else
if
(
Vec_BitEntry
(
vMarks
,
i
)
)
Vec_IntPushUniqueOrder
(
vBlacks
,
Wlc_ObjId
(
p
,
Wlc_ObjFo2Fi
(
p
,
pObj
)
)
),
Count
[
3
]
++
;
}
continue
;
}
}
if
(
vM
uxMark
)
Vec_BitFree
(
vM
uxMark
);
if
(
vM
arks
)
Vec_BitFree
(
vM
arks
);
if
(
pPars
->
fVerbose
)
printf
(
"Abstraction engine marked %d adds/subs, %d muls/divs, %d muxes, and %d flops to be abstracted away.
\n
"
,
Count
[
0
],
Count
[
1
],
Count
[
2
],
Count
[
3
]
);
return
vBlacks
;
...
...
@@ -939,7 +1011,7 @@ int Wlc_NtkPdrAbs( Wlc_Ntk_t * p, Wlc_Par_t * pPars )
if
(
pPars
->
fProofRefine
)
{
if
(
vBlacks
==
NULL
)
vBlacks
=
Wlc_NtkGetBlacks
(
p
,
pPars
,
vUnmark
);
vBlacks
=
Wlc_NtkGetBlacks
(
p
,
pPars
);
else
Wlc_NtkUpdateBlacks
(
p
,
pPars
,
&
vBlacks
,
vUnmark
);
pAbs
=
Wlc_NtkAbs2
(
p
,
vBlacks
,
&
vFfNew
);
...
...
src/base/wlc/wlcCom.c
View file @
9195192f
...
...
@@ -527,9 +527,9 @@ int Abc_CommandPdrAbs( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
-
1
,
"Command line switch
\"
-L
\"
should be followed by an integer.
\n
"
);
goto
usage
;
}
pPars
->
n
Mux
Limit
=
atoi
(
argv
[
globalUtilOptind
]);
pPars
->
nLimit
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
if
(
pPars
->
n
Mux
Limit
<
0
)
if
(
pPars
->
nLimit
<
0
)
goto
usage
;
break
;
case
'a'
:
...
...
@@ -577,7 +577,7 @@ usage:
Abc_Print
(
-
2
,
"
\t
-X num : minimum bit-width of a MUX operator to abstract [default = %d]
\n
"
,
pPars
->
nBitsMux
);
Abc_Print
(
-
2
,
"
\t
-F num : minimum bit-width of a flip-flop to abstract [default = %d]
\n
"
,
pPars
->
nBitsFlop
);
Abc_Print
(
-
2
,
"
\t
-I num : maximum number of CEGAR iterations [default = %d]
\n
"
,
pPars
->
nIterMax
);
Abc_Print
(
-
2
,
"
\t
-L num : maximum number of
muxes [default = %d]
\n
"
,
pPars
->
nMux
Limit
);
Abc_Print
(
-
2
,
"
\t
-L num : maximum number of
each type of signals [default = %d]
\n
"
,
pPars
->
n
Limit
);
Abc_Print
(
-
2
,
"
\t
-x : toggle XORing outputs of word-level miter [default = %s]
\n
"
,
pPars
->
fXorOutput
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-a : toggle running pdr with -nct [default = %s]
\n
"
,
pPars
->
fPdra
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-b : toggle using proof-based refinement [default = %s]
\n
"
,
pPars
->
fProofRefine
?
"yes"
:
"no"
);
...
...
src/base/wlc/wlcNtk.c
View file @
9195192f
...
...
@@ -113,7 +113,7 @@ void Wlc_ManSetDefaultParams( Wlc_Par_t * pPars )
pPars
->
nBitsMux
=
ABC_INFINITY
;
// MUX bit-width
pPars
->
nBitsFlop
=
ABC_INFINITY
;
// flop bit-width
pPars
->
nIterMax
=
1000
;
// the max number of iterations
pPars
->
n
MuxLimit
=
ABC_INFINITY
;
// the max number of muxe
s
pPars
->
n
Limit
=
ABC_INFINITY
;
// the max number of signal
s
pPars
->
fXorOutput
=
1
;
// XOR outputs of word-level miter
pPars
->
fCheckClauses
=
1
;
// Check clauses in the reloaded trace
pPars
->
fPushClauses
=
0
;
// Push clauses in the reloaded trace
...
...
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