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
7724dfcc
Commit
7724dfcc
authored
Mar 30, 2016
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Windowing for technology mapping.
parent
31430043
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
58 additions
and
29 deletions
+58
-29
src/aig/gia/gia.h
+22
-1
src/aig/gia/giaDfs.c
+19
-15
src/aig/gia/giaFrames.c
+1
-1
src/aig/gia/giaIf.c
+5
-5
src/aig/gia/giaMan.c
+1
-0
src/aig/gia/giaSatLut.c
+0
-0
src/aig/gia/giaSplit.c
+0
-0
src/base/abci/abc.c
+9
-6
src/base/abci/abcCollapse.c
+1
-1
No files found.
src/aig/gia/gia.h
View file @
7724dfcc
...
...
@@ -32,6 +32,7 @@
#include <assert.h>
#include "misc/vec/vec.h"
#include "misc/vec/vecWec.h"
#include "misc/util/utilCex.h"
////////////////////////////////////////////////////////////////////////
...
...
@@ -130,7 +131,9 @@ struct Gia_Man_t_
Vec_Int_t
*
vFanoutNums
;
// static fanout
Vec_Int_t
*
vFanout
;
// static fanout
Vec_Int_t
*
vMapping
;
// mapping for each node
Vec_Wec_t
*
vMapping2
;
// mapping for each node
Vec_Int_t
*
vCellMapping
;
// mapping for each node
void
*
pSatlutWinman
;
// windowing for SAT-based mapping
Vec_Int_t
*
vPacking
;
// packing information
Vec_Int_t
*
vConfigs
;
// cell configurations
char
*
pCellStr
;
// cell description
...
...
@@ -986,6 +989,12 @@ static inline int Gia_ObjLutFanin( Gia_Man_t * p, int Id, int i ) { re
static
inline
int
Gia_ObjLutMuxId
(
Gia_Man_t
*
p
,
int
Id
)
{
return
Gia_ObjLutFanins
(
p
,
Id
)[
Gia_ObjLutSize
(
p
,
Id
)];
}
static
inline
int
Gia_ObjLutIsMux
(
Gia_Man_t
*
p
,
int
Id
)
{
return
(
int
)(
Gia_ObjLutMuxId
(
p
,
Id
)
<
0
);
}
static
inline
int
Gia_ManHasMapping2
(
Gia_Man_t
*
p
)
{
return
p
->
vMapping2
!=
NULL
;
}
static
inline
int
Gia_ObjIsLut2
(
Gia_Man_t
*
p
,
int
Id
)
{
return
Vec_IntSize
(
Vec_WecEntry
(
p
->
vMapping2
,
Id
))
!=
0
;
}
static
inline
int
Gia_ObjLutSize2
(
Gia_Man_t
*
p
,
int
Id
)
{
return
Vec_IntSize
(
Vec_WecEntry
(
p
->
vMapping2
,
Id
));
}
static
inline
Vec_Int_t
*
Gia_ObjLutFanins2
(
Gia_Man_t
*
p
,
int
Id
)
{
return
Vec_WecEntry
(
p
->
vMapping2
,
Id
);
}
static
inline
int
Gia_ObjLutFanin2
(
Gia_Man_t
*
p
,
int
Id
,
int
i
)
{
return
Vec_IntEntry
(
Vec_WecEntry
(
p
->
vMapping2
,
Id
),
i
);
}
static
inline
int
Gia_ManHasCellMapping
(
Gia_Man_t
*
p
)
{
return
p
->
vCellMapping
!=
NULL
;
}
static
inline
int
Gia_ObjIsCell
(
Gia_Man_t
*
p
,
int
iLit
)
{
return
Vec_IntEntry
(
p
->
vCellMapping
,
iLit
)
!=
0
;
}
static
inline
int
Gia_ObjIsCellInv
(
Gia_Man_t
*
p
,
int
iLit
)
{
return
Vec_IntEntry
(
p
->
vCellMapping
,
iLit
)
==
-
1
;
}
...
...
@@ -1002,6 +1011,15 @@ static inline int Gia_ObjCellId( Gia_Man_t * p, int iLit ) { re
#define Gia_LutForEachFaninObj( p, i, pFanin, k ) \
for ( k = 0; k < Gia_ObjLutSize(p,i) && ((pFanin = Gia_ManObj(p, Gia_ObjLutFanins(p,i)[k])),1); k++ )
#define Gia_ManForEachLut2( p, i ) \
for ( i = 1; i < Gia_ManObjNum(p); i++ ) if ( !Gia_ObjIsLut2(p, i) ) {} else
#define Gia_LutForEachFanin2( p, i, iFan, k ) \
for ( k = 0; k < Gia_ObjLutSize2(p,i) && ((iFan = Gia_ObjLutFanin2(p,i,k)),1); k++ )
#define Gia_ManForEachLut2Vec( vIds, p, vVec, iObj, i ) \
for ( i = 0; i < Vec_IntSize(vIds) && (vVec = Vec_WecEntry(p->vMapping2, (iObj = Vec_IntEntry(vIds, i)))); i++ )
#define Gia_ManForEachLut2VecReverse( vIds, p, vVec, iObj, i ) \
for ( i = Vec_IntSize(vIds)-1; i >= 0 && (vVec = Vec_WecEntry(p->vMapping2, (iObj = Vec_IntEntry(vIds, i)))); i-- )
#define Gia_ManForEachCell( p, i ) \
for ( i = 2; i < 2*Gia_ManObjNum(p); i++ ) if ( !Gia_ObjIsCell(p, i) ) {} else
#define Gia_CellForEachFanin( p, i, iFanLit, k ) \
...
...
@@ -1118,7 +1136,7 @@ extern Gia_Man_t * Gia_ManDupCofAllInt( Gia_Man_t * p, Vec_Int_t * vSigs
extern
Gia_Man_t
*
Gia_ManDupCofAll
(
Gia_Man_t
*
p
,
int
nFanLim
,
int
fVerbose
);
/*=== giaDfs.c ============================================================*/
extern
void
Gia_ManCollectCis
(
Gia_Man_t
*
p
,
int
*
pNodes
,
int
nNodes
,
Vec_Int_t
*
vSupp
);
extern
void
Gia_ManCollectAnds
(
Gia_Man_t
*
p
,
int
*
pNodes
,
int
nNodes
,
Vec_Int_t
*
vNodes
);
extern
void
Gia_ManCollectAnds
(
Gia_Man_t
*
p
,
int
*
pNodes
,
int
nNodes
,
Vec_Int_t
*
vNodes
,
Vec_Int_t
*
vLeaves
);
extern
Vec_Int_t
*
Gia_ManCollectNodesCis
(
Gia_Man_t
*
p
,
int
*
pNodes
,
int
nNodes
);
extern
int
Gia_ManSuppSize
(
Gia_Man_t
*
p
,
int
*
pNodes
,
int
nNodes
);
extern
int
Gia_ManConeSize
(
Gia_Man_t
*
p
,
int
*
pNodes
,
int
nNodes
);
...
...
@@ -1359,6 +1377,9 @@ extern void Gia_ManSimulateRound( Gia_ManSim_t * p );
extern
float
Gia_ManDelayTraceLut
(
Gia_Man_t
*
p
);
extern
float
Gia_ManDelayTraceLutPrint
(
Gia_Man_t
*
p
,
int
fVerbose
);
extern
Gia_Man_t
*
Gia_ManSpeedup
(
Gia_Man_t
*
p
,
int
Percentage
,
int
Degree
,
int
fVerbose
,
int
fVeryVerbose
);
/*=== giaSplit.c ============================================================*/
extern
void
Gia_ManComputeOneWinStart
(
Gia_Man_t
*
p
,
int
fReverse
);
extern
int
Gia_ManComputeOneWin
(
Gia_Man_t
*
p
,
int
iPivot
,
Vec_Int_t
**
pvRoots
,
Vec_Int_t
**
pvNodes
,
Vec_Int_t
**
pvLeaves
,
Vec_Int_t
**
pvAnds
);
/*=== giaStg.c ============================================================*/
extern
void
Gia_ManStgPrint
(
FILE
*
pFile
,
Vec_Int_t
*
vLines
,
int
nIns
,
int
nOuts
,
int
nStates
);
extern
Gia_Man_t
*
Gia_ManStgRead
(
char
*
pFileName
,
int
kHot
,
int
fVerbose
);
...
...
src/aig/gia/giaDfs.c
View file @
7724dfcc
...
...
@@ -96,17 +96,19 @@ void Gia_ManCollectCis( Gia_Man_t * p, int * pNodes, int nNodes, Vec_Int_t * vSu
SeeAlso []
***********************************************************************/
void
Gia_ManCollectAnds_rec
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
p
Obj
,
Vec_Int_t
*
vNodes
)
void
Gia_ManCollectAnds_rec
(
Gia_Man_t
*
p
,
int
i
Obj
,
Vec_Int_t
*
vNodes
)
{
if
(
Gia_ObjIsTravIdCurrent
(
p
,
pObj
)
)
Gia_Obj_t
*
pObj
;
if
(
Gia_ObjIsTravIdCurrentId
(
p
,
iObj
)
)
return
;
Gia_ObjSetTravIdCurrent
(
p
,
pObj
);
Gia_ObjSetTravIdCurrentId
(
p
,
iObj
);
pObj
=
Gia_ManObj
(
p
,
iObj
);
if
(
Gia_ObjIsCi
(
pObj
)
)
return
;
assert
(
Gia_ObjIsAnd
(
pObj
)
);
Gia_ManCollectAnds_rec
(
p
,
Gia_ObjFanin
0
(
p
Obj
),
vNodes
);
Gia_ManCollectAnds_rec
(
p
,
Gia_ObjFanin
1
(
p
Obj
),
vNodes
);
Vec_IntPush
(
vNodes
,
Gia_ObjId
(
p
,
pObj
)
);
Gia_ManCollectAnds_rec
(
p
,
Gia_ObjFanin
Id0
(
pObj
,
i
Obj
),
vNodes
);
Gia_ManCollectAnds_rec
(
p
,
Gia_ObjFanin
Id1
(
pObj
,
i
Obj
),
vNodes
);
Vec_IntPush
(
vNodes
,
iObj
);
}
/**Function*************************************************************
...
...
@@ -120,20 +122,22 @@ void Gia_ManCollectAnds_rec( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vNodes
SeeAlso []
***********************************************************************/
void
Gia_ManCollectAnds
(
Gia_Man_t
*
p
,
int
*
pNodes
,
int
nNodes
,
Vec_Int_t
*
vNodes
)
void
Gia_ManCollectAnds
(
Gia_Man_t
*
p
,
int
*
pNodes
,
int
nNodes
,
Vec_Int_t
*
vNodes
,
Vec_Int_t
*
vLeaves
)
{
Gia_Obj_t
*
pObj
;
int
i
;
Vec_IntClear
(
vNodes
);
int
i
,
iLeaf
;
// Gia_ManIncrementTravId( p );
Gia_ObjSetTravIdCurrent
(
p
,
Gia_ManConst0
(
p
)
);
Gia_ObjSetTravIdCurrentId
(
p
,
0
);
if
(
vLeaves
)
Vec_IntForEachEntry
(
vLeaves
,
iLeaf
,
i
)
Gia_ObjSetTravIdCurrentId
(
p
,
iLeaf
);
Vec_IntClear
(
vNodes
);
for
(
i
=
0
;
i
<
nNodes
;
i
++
)
{
pObj
=
Gia_ManObj
(
p
,
pNodes
[
i
]
);
Gia_Obj_t
*
pObj
=
Gia_ManObj
(
p
,
pNodes
[
i
]
);
if
(
Gia_ObjIsCo
(
pObj
)
)
Gia_ManCollectAnds_rec
(
p
,
Gia_ObjFanin
0
(
pObj
),
vNodes
);
Gia_ManCollectAnds_rec
(
p
,
Gia_ObjFanin
Id0
(
pObj
,
pNodes
[
i
]
),
vNodes
);
else
Gia_ManCollectAnds_rec
(
p
,
p
Obj
,
vNodes
);
Gia_ManCollectAnds_rec
(
p
,
p
Nodes
[
i
]
,
vNodes
);
}
}
...
...
@@ -216,7 +220,7 @@ void Gia_ManCollectTest( Gia_Man_t * p )
Gia_ManForEachCo
(
p
,
pObj
,
i
)
{
iNode
=
Gia_ObjId
(
p
,
pObj
);
Gia_ManCollectAnds
(
p
,
&
iNode
,
1
,
vNodes
);
Gia_ManCollectAnds
(
p
,
&
iNode
,
1
,
vNodes
,
NULL
);
}
Vec_IntFree
(
vNodes
);
ABC_PRT
(
"DFS from each output"
,
Abc_Clock
()
-
clk
);
...
...
src/aig/gia/giaFrames.c
View file @
7724dfcc
...
...
@@ -706,7 +706,7 @@ void Gia_ManFraSupports( Gia_ManFra_t * p )
vIns
=
Vec_IntAlloc
(
100
);
Gia_ManCollectCis
(
p
->
pAig
,
Vec_IntArray
(
vOuts
),
Vec_IntSize
(
vOuts
),
vIns
);
vAnds
=
Vec_IntAlloc
(
100
);
Gia_ManCollectAnds
(
p
->
pAig
,
Vec_IntArray
(
vOuts
),
Vec_IntSize
(
vOuts
),
vAnds
);
Gia_ManCollectAnds
(
p
->
pAig
,
Vec_IntArray
(
vOuts
),
Vec_IntSize
(
vOuts
),
vAnds
,
NULL
);
Vec_PtrWriteEntry
(
p
->
vIns
,
f
,
vIns
);
Vec_PtrWriteEntry
(
p
->
vAnds
,
f
,
vAnds
);
Vec_PtrWriteEntry
(
p
->
vOuts
,
f
,
vOuts
);
...
...
src/aig/gia/giaIf.c
View file @
7724dfcc
...
...
@@ -249,10 +249,10 @@ void Gia_ManSetRefsMapped( Gia_Man_t * p )
ABC_FREE
(
p
->
pRefs
);
p
->
pRefs
=
ABC_CALLOC
(
int
,
Gia_ManObjNum
(
p
)
);
Gia_ManForEachCo
(
p
,
pObj
,
i
)
Gia_ObjRefInc
(
p
,
Gia_ObjFanin0
(
pObj
)
);
Gia_ObjRefInc
Id
(
p
,
Gia_ObjFaninId0p
(
p
,
pObj
)
);
Gia_ManForEachLut
(
p
,
i
)
Gia_LutForEachFanin
(
p
,
i
,
iFan
,
k
)
Gia_ObjRefInc
(
p
,
Gia_ManObj
(
p
,
iFan
)
);
Gia_ObjRefInc
Id
(
p
,
iFan
);
}
/**Function*************************************************************
...
...
@@ -273,10 +273,10 @@ void Gia_ManSetLutRefs( Gia_Man_t * p )
ABC_FREE
(
p
->
pLutRefs
);
p
->
pLutRefs
=
ABC_CALLOC
(
int
,
Gia_ManObjNum
(
p
)
);
Gia_ManForEachCo
(
p
,
pObj
,
i
)
Gia_ObjLutRefInc
(
p
,
Gia_ObjFanin0
(
pObj
)
);
Gia_ObjLutRefInc
Id
(
p
,
Gia_ObjFaninId0p
(
p
,
pObj
)
);
Gia_ManForEachLut
(
p
,
i
)
Gia_LutForEachFanin
(
p
,
i
,
iFan
,
k
)
Gia_ObjLutRefInc
(
p
,
Gia_ManObj
(
p
,
iFan
)
);
Gia_ObjLutRefInc
Id
(
p
,
iFan
);
}
/**Function*************************************************************
...
...
@@ -1568,7 +1568,7 @@ int Gia_ManFromIfLogicFindCell( If_Man_t * pIfMan, Gia_Man_t * pNew, Gia_Man_t *
// collect nodes
Gia_ManIncrementTravId
(
pTemp
);
Id
=
Abc_Lit2Var
(
iLit
);
Gia_ManCollectAnds
(
pTemp
,
&
Id
,
1
,
vCover
);
Gia_ManCollectAnds
(
pTemp
,
&
Id
,
1
,
vCover
,
NULL
);
Vec_IntPrint
(
vCover
);
Gia_ManForEachObjVec
(
vCover
,
pTemp
,
pObj
,
i
)
Gia_ObjPrint
(
pTemp
,
pObj
);
...
...
src/aig/gia/giaMan.c
View file @
7724dfcc
...
...
@@ -113,6 +113,7 @@ void Gia_ManStop( Gia_Man_t * p )
Vec_WrdFreeP
(
&
p
->
vTtMemory
);
Vec_PtrFreeP
(
&
p
->
vTtInputs
);
Vec_IntFreeP
(
&
p
->
vMapping
);
Vec_WecFreeP
(
&
p
->
vMapping2
);
Vec_IntFreeP
(
&
p
->
vCellMapping
);
Vec_IntFreeP
(
&
p
->
vPacking
);
Vec_IntFreeP
(
&
p
->
vConfigs
);
...
...
src/aig/gia/giaSatLut.c
View file @
7724dfcc
This diff is collapsed.
Click to expand it.
src/aig/gia/giaSplit.c
View file @
7724dfcc
This diff is collapsed.
Click to expand it.
src/base/abci/abc.c
View file @
7724dfcc
...
...
@@ -34822,10 +34822,10 @@ usage:
***********************************************************************/
int
Abc_CommandAbc9SatLut
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
void
Gia_ManLutSat
(
Gia_Man_t
*
p
,
int
nNumber
,
int
nConfl
,
int
fVerbose
);
int
c
,
nNumber
=
32
,
nConfl
=
0
,
fVerbose
=
0
;
extern
void
Gia_ManLutSat
(
Gia_Man_t
*
p
,
int
nNumber
,
int
nConfl
,
int
f
Reverse
,
int
f
Verbose
);
int
c
,
nNumber
=
64
,
nConfl
=
500
,
fReverse
=
0
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"NCvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"NC
r
vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -34852,6 +34852,9 @@ int Abc_CommandAbc9SatLut( Abc_Frame_t * pAbc, int argc, char ** argv )
nConfl
=
atoi
(
argv
[
globalUtilOptind
]);
globalUtilOptind
++
;
break
;
case
'r'
:
fReverse
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -34873,14 +34876,15 @@ int Abc_CommandAbc9SatLut( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if
(
Gia_ManLutSizeMax
(
pAbc
->
pGia
)
>
4
)
Abc_Print
(
0
,
"Current AIG has mapping into %d-LUTs.
\n
"
,
Gia_ManLutSizeMax
(
pAbc
->
pGia
)
);
Gia_ManLutSat
(
pAbc
->
pGia
,
nNumber
,
nConfl
,
fVerbose
);
Gia_ManLutSat
(
pAbc
->
pGia
,
nNumber
,
nConfl
,
f
Reverse
,
f
Verbose
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &satlut [-NC num] [-vh]
\n
"
);
Abc_Print
(
-
2
,
"usage: &satlut [-NC num] [-
r
vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs SAT-based remapping of the 4-LUT network
\n
"
);
Abc_Print
(
-
2
,
"
\t
-N num : the limit on the number of AIG nodes in the window [default = %d]
\n
"
,
nNumber
);
Abc_Print
(
-
2
,
"
\t
-C num : the limit on the number of conflicts [default = %d]
\n
"
,
nNumber
);
Abc_Print
(
-
2
,
"
\t
-r : toggles using reverse search [default = %s]
\n
"
,
fReverse
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggles verbose output [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : prints the command usage
\n
"
);
return
1
;
...
...
@@ -40616,7 +40620,6 @@ int Abc_CommandAbc9Test( Abc_Frame_t * pAbc, int argc, char ** argv )
// Gia_ParTest( pAbc->pGia, nWords, nProcs );
Gia_Iso3Test
(
pAbc
->
pGia
);
// printf( "\nThis command is currently disabled.\n\n" );
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &test [-FW num] [-svh]
\n
"
);
src/base/abci/abcCollapse.c
View file @
7724dfcc
...
...
@@ -750,7 +750,7 @@ Vec_Str_t * Abc_NtkClpGiaOne2( Cnf_Dat_t * pCnf, Gia_Man_t * p, int iCo, int nCu
Gia_ManForEachCiVec
(
vSupp
,
p
,
pObj
,
i
)
Vec_IntPush
(
vSuppObjs
,
Gia_ObjId
(
p
,
pObj
)
);
Gia_ManIncrementTravId
(
p
);
Gia_ManCollectAnds
(
p
,
&
iCoObjId
,
1
,
vAnds
);
Gia_ManCollectAnds
(
p
,
&
iCoObjId
,
1
,
vAnds
,
NULL
);
assert
(
Vec_IntSize
(
vAnds
)
>
0
);
// pSat = Abc_NtkClpDeriveSatSolver( pCnf, iCoObjId, vSuppObjs, vAnds, vMap, &pSat1, &pSat2, &pSat3 );
pSat
=
Abc_NtkClpDeriveSatSolver
(
pCnf
,
iCoObjId
,
vSuppObjs
,
vAnds
,
vMap
,
NULL
,
NULL
,
NULL
);
...
...
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