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
4a50b09c
Commit
4a50b09c
authored
Jul 13, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New technology mapper.
parent
aaa8121e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
67 deletions
+72
-67
src/base/abci/abc.c
+1
-1
src/map/mpm/mpmInt.h
+1
-2
src/map/mpm/mpmMan.c
+2
-0
src/map/mpm/mpmMap.c
+48
-45
src/map/mpm/mpmTruth.c
+20
-19
No files found.
src/base/abci/abc.c
View file @
4a50b09c
...
@@ -29589,7 +29589,7 @@ usage:
...
@@ -29589,7 +29589,7 @@ usage:
sprintf
(
Buffer
,
"%d"
,
pPars
->
DelayTarget
);
sprintf
(
Buffer
,
"%d"
,
pPars
->
DelayTarget
);
Abc_Print
(
-
2
,
"usage: &if2 [-KD num] [-mzvh]
\n
"
);
Abc_Print
(
-
2
,
"usage: &if2 [-KD num] [-mzvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs technology mapping of the network
\n
"
);
Abc_Print
(
-
2
,
"
\t
performs technology mapping of the network
\n
"
);
Abc_Print
(
-
2
,
"
\t
-K num : sets the LUT size for the mapping [default = %
s
]
\n
"
,
nLutSize
);
Abc_Print
(
-
2
,
"
\t
-K num : sets the LUT size for the mapping [default = %
d
]
\n
"
,
nLutSize
);
Abc_Print
(
-
2
,
"
\t
-D num : sets the delay constraint for the mapping [default = %s]
\n
"
,
Buffer
);
Abc_Print
(
-
2
,
"
\t
-D num : sets the delay constraint for the mapping [default = %s]
\n
"
,
Buffer
);
Abc_Print
(
-
2
,
"
\t
-m : enables cut minimization by removing vacuous variables [default = %s]
\n
"
,
pPars
->
fCutMin
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-m : enables cut minimization by removing vacuous variables [default = %s]
\n
"
,
pPars
->
fCutMin
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-z : toggles deriving LUTs when mapping into LUT structures [default = %s]
\n
"
,
pPars
->
fDeriveLuts
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-z : toggles deriving LUTs when mapping into LUT structures [default = %s]
\n
"
,
pPars
->
fDeriveLuts
?
"yes"
:
"no"
);
src/map/mpm/mpmInt.h
View file @
4a50b09c
...
@@ -103,8 +103,7 @@ struct Mpm_Man_t_
...
@@ -103,8 +103,7 @@ struct Mpm_Man_t_
Vec_Ptr_t
*
vTemp
;
// storage for cuts
Vec_Ptr_t
*
vTemp
;
// storage for cuts
// object presence
// object presence
unsigned
char
*
pObjPres
;
// object presence
unsigned
char
*
pObjPres
;
// object presence
int
pObjPresUsed
[
MPM_VAR_MAX
];
Vec_Int_t
vObjPresUsed
;
// used objects
int
nObjPresUsed
;
Vec_Str_t
vObjShared
;
// object presence
Vec_Str_t
vObjShared
;
// object presence
// cut comparison
// cut comparison
int
(
*
pCutCmp
)
(
Mpm_Uni_t
*
,
Mpm_Uni_t
*
);
// procedure to compare cuts
int
(
*
pCutCmp
)
(
Mpm_Uni_t
*
,
Mpm_Uni_t
*
);
// procedure to compare cuts
...
...
src/map/mpm/mpmMan.c
View file @
4a50b09c
...
@@ -65,6 +65,7 @@ Mpm_Man_t * Mpm_ManStart( Mig_Man_t * pMig, Mpm_Par_t * pPars )
...
@@ -65,6 +65,7 @@ Mpm_Man_t * Mpm_ManStart( Mig_Man_t * pMig, Mpm_Par_t * pPars )
for
(
i
=
p
->
nNumCuts
;
i
>=
0
;
i
--
)
for
(
i
=
p
->
nNumCuts
;
i
>=
0
;
i
--
)
Vec_PtrPush
(
&
p
->
vFreeUnits
,
p
->
pCutUnits
+
i
);
Vec_PtrPush
(
&
p
->
vFreeUnits
,
p
->
pCutUnits
+
i
);
p
->
pObjPres
=
ABC_FALLOC
(
unsigned
char
,
Mig_ManObjNum
(
pMig
)
);
p
->
pObjPres
=
ABC_FALLOC
(
unsigned
char
,
Mig_ManObjNum
(
pMig
)
);
Vec_IntGrow
(
&
p
->
vObjPresUsed
,
p
->
nLutSize
);
Vec_StrGrow
(
&
p
->
vObjShared
,
32
);
Vec_StrGrow
(
&
p
->
vObjShared
,
32
);
p
->
vTemp
=
Vec_PtrAlloc
(
1000
);
p
->
vTemp
=
Vec_PtrAlloc
(
1000
);
// mapping attributes
// mapping attributes
...
@@ -114,6 +115,7 @@ void Mpm_ManStop( Mpm_Man_t * p )
...
@@ -114,6 +115,7 @@ void Mpm_ManStop( Mpm_Man_t * p )
}
}
Vec_PtrFree
(
p
->
vTemp
);
Vec_PtrFree
(
p
->
vTemp
);
Mmr_StepStop
(
p
->
pManCuts
);
Mmr_StepStop
(
p
->
pManCuts
);
ABC_FREE
(
p
->
vObjPresUsed
.
pArray
);
ABC_FREE
(
p
->
vFreeUnits
.
pArray
);
ABC_FREE
(
p
->
vFreeUnits
.
pArray
);
ABC_FREE
(
p
->
vObjShared
.
pArray
);
ABC_FREE
(
p
->
vObjShared
.
pArray
);
ABC_FREE
(
p
->
pObjPres
);
ABC_FREE
(
p
->
pObjPres
);
...
...
src/map/mpm/mpmMap.c
View file @
4a50b09c
...
@@ -170,12 +170,12 @@ static inline void Mpm_CutDeref( Mpm_Man_t * p, int * pLeaves, int nLeaves )
...
@@ -170,12 +170,12 @@ static inline void Mpm_CutDeref( Mpm_Man_t * p, int * pLeaves, int nLeaves )
Mig_ManObj( p->pMig, Abc_Lit2Var(pLeaves[i]) )->nMapRefs--;
Mig_ManObj( p->pMig, Abc_Lit2Var(pLeaves[i]) )->nMapRefs--;
}
}
*/
*/
static
inline
void
Mpm_CutPrint
(
int
*
pLeaves
,
int
nLeaves
)
static
inline
void
Mpm_CutPrint
(
Mpm_Cut_t
*
pCut
)
{
{
int
i
;
int
i
;
printf
(
"%d : { "
,
nLeaves
);
printf
(
"%d : { "
,
pCut
->
nLeaves
);
for
(
i
=
0
;
i
<
nLeaves
;
i
++
)
for
(
i
=
0
;
i
<
(
int
)
pCut
->
nLeaves
;
i
++
)
printf
(
"%d "
,
pLeaves
[
i
]
);
printf
(
"%d "
,
p
Cut
->
p
Leaves
[
i
]
);
printf
(
"}
\n
"
);
printf
(
"}
\n
"
);
}
}
static
inline
void
Mpm_CutPrintAll
(
Mpm_Man_t
*
p
)
static
inline
void
Mpm_CutPrintAll
(
Mpm_Man_t
*
p
)
...
@@ -184,46 +184,33 @@ static inline void Mpm_CutPrintAll( Mpm_Man_t * p )
...
@@ -184,46 +184,33 @@ static inline void Mpm_CutPrintAll( Mpm_Man_t * p )
for
(
i
=
0
;
i
<
p
->
nCutStore
;
i
++
)
for
(
i
=
0
;
i
<
p
->
nCutStore
;
i
++
)
{
{
printf
(
"%2d : "
,
i
);
printf
(
"%2d : "
,
i
);
Mpm_CutPrint
(
p
->
pCutStore
[
i
]
->
pCut
.
pLeaves
,
p
->
pCutStore
[
i
]
->
pCut
.
nLeaves
);
Mpm_CutPrint
(
&
p
->
pCutStore
[
i
]
->
pCut
);
}
}
}
}
static
inline
int
Mpm_ManSetIsSmaller
(
Mpm_Man_t
*
p
,
Mpm_Cut_t
*
pCut
,
int
nTotal
)
// check if pCut is contained in the current one (p->pCutTemp)
/**Function*************************************************************
Synopsis [Cut merging.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
int
Mpm_ManSetIsSmaller
(
Mpm_Man_t
*
p
,
int
*
pLits
,
int
nLits
,
int
nTotal
)
// check if pCut is contained in the current one (p->pCutTemp)
{
{
int
i
,
Index
;
int
i
,
Index
;
for
(
i
=
0
;
i
<
nLit
s
;
i
++
)
for
(
i
=
0
;
i
<
(
int
)
pCut
->
nLeave
s
;
i
++
)
{
{
Index
=
(
int
)
p
->
pObjPres
[
Abc_Lit2Var
(
p
Lit
s
[
i
])];
Index
=
(
int
)
p
->
pObjPres
[
Abc_Lit2Var
(
p
Cut
->
pLeave
s
[
i
])];
if
(
Index
==
0xFF
)
if
(
Index
==
0xFF
)
return
0
;
return
0
;
assert
(
Index
<
nTotal
);
//
assert( Index < nTotal );
}
}
return
1
;
return
1
;
}
}
static
inline
int
Mpm_ManSetIsBigger
(
Mpm_Man_t
*
p
,
int
*
pLits
,
int
nLits
,
int
nTotal
)
// check if pCut contains the current one (p->pCutTemp)
static
inline
int
Mpm_ManSetIsBigger
(
Mpm_Man_t
*
p
,
Mpm_Cut_t
*
pCut
,
int
nTotal
)
// check if pCut contains the current one (p->pCutTemp)
{
{
int
i
,
Index
;
int
i
,
Index
,
Counter
=
0
;
unsigned
uMask
=
0
;
for
(
i
=
0
;
i
<
(
int
)
pCut
->
nLeaves
;
i
++
)
for
(
i
=
0
;
i
<
nLits
;
i
++
)
{
{
Index
=
(
int
)
p
->
pObjPres
[
Abc_Lit2Var
(
p
Lit
s
[
i
])];
Index
=
(
int
)
p
->
pObjPres
[
Abc_Lit2Var
(
p
Cut
->
pLeave
s
[
i
])];
if
(
Index
==
0xFF
)
if
(
Index
==
0xFF
)
continue
;
continue
;
assert
(
Index
<
nTotal
);
//
assert( Index < nTotal );
uMask
|=
(
1
<<
Index
)
;
Counter
++
;
}
}
return
uMask
==
~
(
~
(
unsigned
)
0
<<
nTotal
);
return
(
int
)(
Counter
==
nTotal
);
}
}
/**Function*************************************************************
/**Function*************************************************************
...
@@ -278,6 +265,7 @@ static inline Mpm_Uni_t * Mpm_CutSetupInfo( Mpm_Man_t * p, Mpm_Cut_t * pCut, int
...
@@ -278,6 +265,7 @@ static inline Mpm_Uni_t * Mpm_CutSetupInfo( Mpm_Man_t * p, Mpm_Cut_t * pCut, int
pUnit
->
mEdge
=
MPM_UNIT_EDGE
*
pCut
->
nLeaves
;
pUnit
->
mEdge
=
MPM_UNIT_EDGE
*
pCut
->
nLeaves
;
pUnit
->
mAveRefs
=
0
;
pUnit
->
mAveRefs
=
0
;
pUnit
->
Cost
=
0
;
pUnit
->
Cost
=
0
;
pUnit
->
uSign
=
0
;
Mpm_CutForEachLeafId
(
pCut
,
iLeaf
,
i
)
Mpm_CutForEachLeafId
(
pCut
,
iLeaf
,
i
)
{
{
if
(
p
->
fMainRun
&&
pMapRefs
[
iLeaf
]
==
0
)
// not used in the mapping
if
(
p
->
fMainRun
&&
pMapRefs
[
iLeaf
]
==
0
)
// not used in the mapping
...
@@ -294,7 +282,7 @@ static inline Mpm_Uni_t * Mpm_CutSetupInfo( Mpm_Man_t * p, Mpm_Cut_t * pCut, int
...
@@ -294,7 +282,7 @@ static inline Mpm_Uni_t * Mpm_CutSetupInfo( Mpm_Man_t * p, Mpm_Cut_t * pCut, int
}
}
pUnit
->
uSign
|=
((
word
)
1
<<
(
iLeaf
&
0x3F
));
pUnit
->
uSign
|=
((
word
)
1
<<
(
iLeaf
&
0x3F
));
}
}
pUnit
->
mAveRefs
=
pUnit
->
mAveRefs
*
MPM_UNIT_EDGE
/
pCut
->
nLeaves
;
pUnit
->
mAveRefs
=
pUnit
->
mAveRefs
*
MPM_UNIT_EDGE
/
Abc_MaxInt
(
pCut
->
nLeaves
,
1
)
;
return
pUnit
;
return
pUnit
;
}
}
...
@@ -352,7 +340,7 @@ clk = Abc_Clock();
...
@@ -352,7 +340,7 @@ clk = Abc_Clock();
pUnit
=
p
->
pCutStore
[
k
];
pUnit
=
p
->
pCutStore
[
k
];
if
(
pUnitNew
->
pCut
.
nLeaves
>=
pUnit
->
pCut
.
nLeaves
&&
if
(
pUnitNew
->
pCut
.
nLeaves
>=
pUnit
->
pCut
.
nLeaves
&&
(
pUnitNew
->
uSign
&
pUnit
->
uSign
)
==
pUnit
->
uSign
&&
(
pUnitNew
->
uSign
&
pUnit
->
uSign
)
==
pUnit
->
uSign
&&
Mpm_ManSetIsSmaller
(
p
,
pUnit
->
pCut
.
pLeaves
,
pUnit
->
pCut
.
nLeaves
,
pUnitNew
->
pCut
.
nLeaves
)
)
Mpm_ManSetIsSmaller
(
p
,
&
pUnit
->
pCut
,
pUnitNew
->
pCut
.
nLeaves
)
)
{
{
#ifdef MIG_RUNTIME
#ifdef MIG_RUNTIME
p
->
timeCompare
+=
Abc_Clock
()
-
clk
;
p
->
timeCompare
+=
Abc_Clock
()
-
clk
;
...
@@ -384,7 +372,7 @@ p->timeCompare += Abc_Clock() - clk;
...
@@ -384,7 +372,7 @@ p->timeCompare += Abc_Clock() - clk;
pUnit
=
p
->
pCutStore
[
k
];
pUnit
=
p
->
pCutStore
[
k
];
if
(
pUnitNew
->
pCut
.
nLeaves
<=
pUnit
->
pCut
.
nLeaves
&&
if
(
pUnitNew
->
pCut
.
nLeaves
<=
pUnit
->
pCut
.
nLeaves
&&
(
pUnitNew
->
uSign
&
pUnit
->
uSign
)
==
pUnitNew
->
uSign
&&
(
pUnitNew
->
uSign
&
pUnit
->
uSign
)
==
pUnitNew
->
uSign
&&
Mpm_ManSetIsBigger
(
p
,
pUnit
->
pCut
.
pLeaves
,
pUnit
->
pCut
.
nLeaves
,
pUnitNew
->
pCut
.
nLeaves
)
)
Mpm_ManSetIsBigger
(
p
,
&
pUnit
->
pCut
,
pUnitNew
->
pCut
.
nLeaves
)
)
{
{
Vec_PtrPush
(
&
p
->
vFreeUnits
,
pUnit
);
Vec_PtrPush
(
&
p
->
vFreeUnits
,
pUnit
);
continue
;
continue
;
...
@@ -422,7 +410,7 @@ void Mpm_ObjAddChoiceCutsToStore( Mpm_Man_t * p, Mig_Obj_t * pObj, int ReqTime )
...
@@ -422,7 +410,7 @@ void Mpm_ObjAddChoiceCutsToStore( Mpm_Man_t * p, Mig_Obj_t * pObj, int ReqTime )
// create cuts at the node from storage
// create cuts at the node from storage
void
Mpm_ObjTranslateCutsFromStore
(
Mpm_Man_t
*
p
,
Mig_Obj_t
*
pObj
,
int
fAddUnit
)
void
Mpm_ObjTranslateCutsFromStore
(
Mpm_Man_t
*
p
,
Mig_Obj_t
*
pObj
,
int
fAddUnit
)
{
{
Mpm_Cut_t
*
pCut
;
Mpm_Cut_t
*
pCut
=
NULL
;
Mpm_Uni_t
*
pUnit
;
Mpm_Uni_t
*
pUnit
;
int
i
,
*
pList
=
Mpm_ObjCutListP
(
p
,
pObj
);
int
i
,
*
pList
=
Mpm_ObjCutListP
(
p
,
pObj
);
assert
(
p
->
nCutStore
>
0
&&
p
->
nCutStore
<=
p
->
nNumCuts
);
assert
(
p
->
nCutStore
>
0
&&
p
->
nCutStore
<=
p
->
nNumCuts
);
...
@@ -435,6 +423,8 @@ void Mpm_ObjTranslateCutsFromStore( Mpm_Man_t * p, Mig_Obj_t * pObj, int fAddUni
...
@@ -435,6 +423,8 @@ void Mpm_ObjTranslateCutsFromStore( Mpm_Man_t * p, Mig_Obj_t * pObj, int fAddUni
pList
=
&
pCut
->
hNext
;
pList
=
&
pCut
->
hNext
;
Vec_PtrPush
(
&
p
->
vFreeUnits
,
pUnit
);
Vec_PtrPush
(
&
p
->
vFreeUnits
,
pUnit
);
}
}
if
(
p
->
nCutStore
==
1
&&
pCut
->
nLeaves
<
2
)
fAddUnit
=
0
;
*
pList
=
fAddUnit
?
Mpm_CutCreateUnit
(
p
,
Mig_ObjId
(
pObj
)
)
:
0
;
*
pList
=
fAddUnit
?
Mpm_CutCreateUnit
(
p
,
Mig_ObjId
(
pObj
)
)
:
0
;
assert
(
Vec_PtrSize
(
&
p
->
vFreeUnits
)
==
p
->
nNumCuts
+
1
);
assert
(
Vec_PtrSize
(
&
p
->
vFreeUnits
)
==
p
->
nNumCuts
+
1
);
}
}
...
@@ -513,16 +503,26 @@ static inline int Mpm_ObjDeriveCut( Mpm_Man_t * p, Mpm_Cut_t ** pCuts, Mpm_Cut_t
...
@@ -513,16 +503,26 @@ static inline int Mpm_ObjDeriveCut( Mpm_Man_t * p, Mpm_Cut_t ** pCuts, Mpm_Cut_t
{
{
int
i
,
c
,
iObj
;
int
i
,
c
,
iObj
;
// clean present objects
// clean present objects
for
(
i
=
0
;
i
<
p
->
nObjPresUsed
;
i
++
)
// Vec_IntForEachEntry( &p->vObjPresUsed, iObj, i )
p
->
pObjPres
[
p
->
pObjPresUsed
[
i
]]
=
(
unsigned
char
)
0xFF
;
// p->pObjPres[iObj] = (unsigned char)0xFF;
p
->
nObjPresUsed
=
0
;
for
(
i
=
0
;
i
<
p
->
vObjPresUsed
.
nSize
;
i
++
)
p
->
pObjPres
[
p
->
vObjPresUsed
.
pArray
[
i
]]
=
(
unsigned
char
)
0xFF
;
Vec_IntClear
(
&
p
->
vObjPresUsed
);
Vec_StrClear
(
&
p
->
vObjShared
);
Vec_StrClear
(
&
p
->
vObjShared
);
// check present objects
// check present objects
// for ( i = 0; i < Mig_ManObjNum(p->pMig); i++ )
// for ( i = 0; i < Mig_ManObjNum(p->pMig); i++ )
// assert( p->pObjPres[i] == (unsigned char)0xFF );
// assert( p->pObjPres[i] == (unsigned char)0xFF );
//
collect cuts
//
base cut
pCut
->
nLeaves
=
0
;
pCut
->
nLeaves
=
0
;
for
(
c
=
0
;
pCuts
[
c
]
&&
c
<
3
;
c
++
)
for
(
i
=
0
;
i
<
(
int
)
pCuts
[
0
]
->
nLeaves
;
i
++
)
{
iObj
=
Abc_Lit2Var
(
pCuts
[
0
]
->
pLeaves
[
i
]);
Vec_IntPush
(
&
p
->
vObjPresUsed
,
iObj
);
p
->
pObjPres
[
iObj
]
=
pCut
->
nLeaves
;
pCut
->
pLeaves
[
pCut
->
nLeaves
++
]
=
pCuts
[
0
]
->
pLeaves
[
i
];
}
// remaining cuts
for
(
c
=
1
;
pCuts
[
c
]
&&
c
<
3
;
c
++
)
{
{
for
(
i
=
0
;
i
<
(
int
)
pCuts
[
c
]
->
nLeaves
;
i
++
)
for
(
i
=
0
;
i
<
(
int
)
pCuts
[
c
]
->
nLeaves
;
i
++
)
{
{
...
@@ -531,7 +531,7 @@ static inline int Mpm_ObjDeriveCut( Mpm_Man_t * p, Mpm_Cut_t ** pCuts, Mpm_Cut_t
...
@@ -531,7 +531,7 @@ static inline int Mpm_ObjDeriveCut( Mpm_Man_t * p, Mpm_Cut_t ** pCuts, Mpm_Cut_t
continue
;
continue
;
if
(
(
int
)
pCut
->
nLeaves
==
p
->
nLutSize
)
if
(
(
int
)
pCut
->
nLeaves
==
p
->
nLutSize
)
return
0
;
return
0
;
p
->
pObjPresUsed
[
p
->
nObjPresUsed
++
]
=
iObj
;
Vec_IntPush
(
&
p
->
vObjPresUsed
,
iObj
)
;
p
->
pObjPres
[
iObj
]
=
pCut
->
nLeaves
;
p
->
pObjPres
[
iObj
]
=
pCut
->
nLeaves
;
pCut
->
pLeaves
[
pCut
->
nLeaves
++
]
=
pCuts
[
c
]
->
pLeaves
[
i
];
pCut
->
pLeaves
[
pCut
->
nLeaves
++
]
=
pCuts
[
c
]
->
pLeaves
[
i
];
}
}
...
@@ -564,6 +564,10 @@ p->timeMerge += clock() - clk;
...
@@ -564,6 +564,10 @@ p->timeMerge += clock() - clk;
return
1
;
return
1
;
}
}
// derive truth table
if
(
p
->
pPars
->
fUseTruth
)
Mpm_CutComputeTruth6
(
p
,
pCut
,
pCuts
[
0
],
pCuts
[
1
],
pCuts
[
2
],
Mig_ObjFaninC0
(
pObj
),
Mig_ObjFaninC1
(
pObj
),
Mig_ObjFaninC2
(
pObj
),
Mig_ObjNodeType
(
pObj
)
);
#ifdef MIG_RUNTIME
#ifdef MIG_RUNTIME
p
->
timeMerge
+=
clock
()
-
clk
;
p
->
timeMerge
+=
clock
()
-
clk
;
clk
=
clock
();
clk
=
clock
();
...
@@ -576,10 +580,6 @@ p->timeEval += clock() - clk;
...
@@ -576,10 +580,6 @@ p->timeEval += clock() - clk;
if
(
p
->
fMainRun
&&
ArrTime
>
Required
)
if
(
p
->
fMainRun
&&
ArrTime
>
Required
)
return
1
;
return
1
;
// derive truth table
if
(
p
->
pPars
->
fUseTruth
)
Mpm_CutComputeTruth6
(
p
,
pCut
,
pCuts
[
0
],
pCuts
[
1
],
pCuts
[
2
],
Mig_ObjFaninC0
(
pObj
),
Mig_ObjFaninC1
(
pObj
),
Mig_ObjFaninC2
(
pObj
),
Mig_ObjNodeType
(
pObj
)
);
#ifdef MIG_RUNTIME
#ifdef MIG_RUNTIME
clk
=
Abc_Clock
();
clk
=
Abc_Clock
();
#endif
#endif
...
@@ -673,6 +673,8 @@ finish:
...
@@ -673,6 +673,8 @@ finish:
Mpm_ObjSetTime
(
p
,
pObj
,
p
->
pCutStore
[
0
]
->
mTime
);
Mpm_ObjSetTime
(
p
,
pObj
,
p
->
pCutStore
[
0
]
->
mTime
);
Mpm_ObjSetArea
(
p
,
pObj
,
p
->
pCutStore
[
0
]
->
mArea
);
Mpm_ObjSetArea
(
p
,
pObj
,
p
->
pCutStore
[
0
]
->
mArea
);
Mpm_ObjSetEdge
(
p
,
pObj
,
p
->
pCutStore
[
0
]
->
mEdge
);
Mpm_ObjSetEdge
(
p
,
pObj
,
p
->
pCutStore
[
0
]
->
mEdge
);
// if ( pCut->nLeaves < 1 )
// printf( "%d ", pCut->nLeaves );
}
}
else
assert
(
!
p
->
fMainRun
);
else
assert
(
!
p
->
fMainRun
);
assert
(
hCutBest
>
0
);
assert
(
hCutBest
>
0
);
...
@@ -837,9 +839,10 @@ void Mpm_ManPerformRound( Mpm_Man_t * p )
...
@@ -837,9 +839,10 @@ void Mpm_ManPerformRound( Mpm_Man_t * p )
Mig_ManForEachNode
(
p
->
pMig
,
pObj
)
Mig_ManForEachNode
(
p
->
pMig
,
pObj
)
Mpm_ManDeriveCuts
(
p
,
pObj
);
Mpm_ManDeriveCuts
(
p
,
pObj
);
Mpm_ManFinalizeRound
(
p
);
Mpm_ManFinalizeRound
(
p
);
printf
(
"Del =%5d. Ar =%8d. Edge =%8d. Cut =%10d. Max =%10d.
Rem =%6d.
"
,
printf
(
"Del =%5d. Ar =%8d. Edge =%8d. Cut =%10d. Max =%10d.
Tru =%6d. Small =%5d.
"
,
p
->
GloRequired
,
p
->
GloArea
,
p
->
GloEdge
,
p
->
GloRequired
,
p
->
GloArea
,
p
->
GloEdge
,
p
->
nCutsMerged
,
p
->
pManCuts
->
nEntriesMax
,
p
->
pManCuts
->
nEntries
);
p
->
nCutsMerged
,
p
->
pManCuts
->
nEntriesMax
,
p
->
vTtMem
?
p
->
vTtMem
->
nEntries
:
0
,
p
->
nSmallSupp
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
}
}
void
Mpm_ManPerform
(
Mpm_Man_t
*
p
)
void
Mpm_ManPerform
(
Mpm_Man_t
*
p
)
...
...
src/map/mpm/mpmTruth.c
View file @
4a50b09c
...
@@ -47,36 +47,37 @@ static inline int Mpm_CutTruthMinimize6( Mpm_Man_t * p, Mpm_Cut_t * pCut )
...
@@ -47,36 +47,37 @@ static inline int Mpm_CutTruthMinimize6( Mpm_Man_t * p, Mpm_Cut_t * pCut )
{
{
unsigned
uSupport
;
unsigned
uSupport
;
int
i
,
k
,
nSuppSize
;
int
i
,
k
,
nSuppSize
;
word
t
=
*
Mpm_CutTruth
(
p
,
Abc_Lit2Var
(
pCut
->
iFunc
)
);
// compute the support of the cut's function
// compute the support of the cut's function
word
t
=
*
Mpm_CutTruth
(
p
,
Abc_Lit2Var
(
pCut
->
iFunc
)
);
uSupport
=
Abc_Tt6SupportAndSize
(
t
,
Mpm_CutLeafNum
(
pCut
),
&
nSuppSize
);
uSupport
=
Abc_Tt6SupportAndSize
(
t
,
Mpm_CutLeafNum
(
pCut
),
&
nSuppSize
);
if
(
nSuppSize
==
Mpm_CutLeafNum
(
pCut
)
)
if
(
nSuppSize
==
Mpm_CutLeafNum
(
pCut
)
)
return
0
;
return
0
;
if
(
nSuppSize
<
2
)
p
->
nSmallSupp
+=
(
int
)(
nSuppSize
<
2
);
p
->
nSmallSupp
++
;
// update leaves and signature
// update leaves and signature
for
(
i
=
k
=
0
;
i
<
Mpm_CutLeafNum
(
pCut
);
i
++
)
for
(
i
=
k
=
0
;
i
<
Mpm_CutLeafNum
(
pCut
);
i
++
)
{
{
if
(
!
(
uSupport
&
(
1
<<
i
))
)
if
(
((
uSupport
>>
i
)
&
1
)
)
continue
;
if
(
k
<
i
)
{
{
pCut
->
pLeaves
[
k
]
=
pCut
->
pLeaves
[
i
];
if
(
k
<
i
)
Abc_TtSwapVars
(
&
t
,
p
->
nLutSize
,
k
,
i
);
{
pCut
->
pLeaves
[
k
]
=
pCut
->
pLeaves
[
i
];
Abc_TtSwapVars
(
&
t
,
p
->
nLutSize
,
k
,
i
);
}
k
++
;
}
else
{
int
iObj
=
Abc_Lit2Var
(
pCut
->
pLeaves
[
i
]
);
int
Res
=
Vec_IntRemove
(
&
p
->
vObjPresUsed
,
iObj
);
assert
(
Res
==
1
);
p
->
pObjPres
[
iObj
]
=
(
unsigned
char
)
0xFF
;
}
}
k
++
;
}
}
assert
(
k
==
nSuppSize
);
assert
(
k
==
nSuppSize
);
pCut
->
nLeaves
=
nSuppSize
;
pCut
->
nLeaves
=
nSuppSize
;
assert
(
nSuppSize
==
Abc_TtSupportSize
(
&
t
,
Mpm_CutLeafNum
(
pCut
)
)
);
assert
(
nSuppSize
==
Abc_TtSupportSize
(
&
t
,
6
)
);
// save the result
// save the result
if
(
t
&
1
)
pCut
->
iFunc
=
Abc_Var2Lit
(
Vec_MemHashInsert
(
p
->
vTtMem
,
&
t
),
Abc_LitIsCompl
(
pCut
->
iFunc
)
);
{
t
=
~
t
;
pCut
->
iFunc
=
Abc_Var2Lit
(
Vec_MemHashInsert
(
p
->
vTtMem
,
&
t
),
1
);
}
else
pCut
->
iFunc
=
Abc_Var2Lit
(
Vec_MemHashInsert
(
p
->
vTtMem
,
&
t
),
0
);
return
1
;
return
1
;
}
}
static
inline
word
Mpm_TruthStretch6
(
word
Truth
,
Mpm_Cut_t
*
pCut
,
Mpm_Cut_t
*
pCut0
,
int
nLimit
)
static
inline
word
Mpm_TruthStretch6
(
word
Truth
,
Mpm_Cut_t
*
pCut
,
Mpm_Cut_t
*
pCut0
,
int
nLimit
)
...
@@ -134,8 +135,8 @@ int Mpm_CutComputeTruth6( Mpm_Man_t * p, Mpm_Cut_t * pCut, Mpm_Cut_t * pCut0, Mp
...
@@ -134,8 +135,8 @@ int Mpm_CutComputeTruth6( Mpm_Man_t * p, Mpm_Cut_t * pCut, Mpm_Cut_t * pCut0, Mp
}
}
#endif
#endif
//
if ( p->pPars->fCutMin )
if
(
p
->
pPars
->
fCutMin
)
//
return Mpm_CutTruthMinimize6( p, pCut );
return
Mpm_CutTruthMinimize6
(
p
,
pCut
);
return
0
;
return
0
;
}
}
...
...
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