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
9e723d40
Commit
9e723d40
authored
Jul 18, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New technology mapper.
parent
7630f2bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
53 deletions
+32
-53
src/map/mpm/mpmMan.c
+17
-17
src/map/mpm/mpmMap.c
+15
-35
src/map/mpm/mpmMig.h
+0
-1
No files found.
src/map/mpm/mpmMan.c
View file @
9e723d40
...
@@ -180,23 +180,23 @@ void Mpm_ManPrintStats( Mpm_Man_t * p )
...
@@ -180,23 +180,23 @@ void Mpm_ManPrintStats( Mpm_Man_t * p )
1
.
0
*
Mig_ManObjNum
(
p
->
pMig
)
*
sizeof
(
Mig_Obj_t
)
/
(
1
<<
20
)
+
1
.
0
*
Mig_ManObjNum
(
p
->
pMig
)
*
sizeof
(
Mig_Obj_t
)
/
(
1
<<
20
)
+
1
.
0
*
Mig_ManObjNum
(
p
->
pMig
)
*
48
/
(
1
<<
20
)
+
1
.
0
*
Mig_ManObjNum
(
p
->
pMig
)
*
48
/
(
1
<<
20
)
+
1
.
0
*
Mmr_StepMemory
(
p
->
pManCuts
)
/
(
1
<<
17
)
);
1
.
0
*
Mmr_StepMemory
(
p
->
pManCuts
)
/
(
1
<<
17
)
);
if
(
p
->
timeDerive
)
#ifdef MIG_RUNTIME
{
printf
(
"
\n
"
);
printf
(
"
\n
"
);
p
->
timeTotal
=
Abc_Clock
()
-
p
->
timeTotal
;
p
->
timeTotal
=
Abc_Clock
()
-
p
->
timeTotal
;
p
->
timeOther
=
p
->
timeTotal
-
p
->
timeDerive
;
p
->
timeOther
=
p
->
timeTotal
-
p
->
timeDerive
;
Abc_Print
(
1
,
"Runtime breakdown:
\n
"
);
Abc_Print
(
1
,
"Runtime breakdown:
\n
"
);
ABC_PRTP
(
"Complete cut computation "
,
p
->
timeDerive
,
p
->
timeTotal
);
ABC_PRTP
(
"Complete cut computation "
,
p
->
timeDerive
,
p
->
timeTotal
);
ABC_PRTP
(
"- Merging cuts "
,
p
->
timeMerge
,
p
->
timeTotal
);
ABC_PRTP
(
"- Merging cuts "
,
p
->
timeMerge
,
p
->
timeTotal
);
ABC_PRTP
(
"- Evaluting cut parameters "
,
p
->
timeEval
,
p
->
timeTotal
);
ABC_PRTP
(
"- Evaluting cut parameters "
,
p
->
timeEval
,
p
->
timeTotal
);
ABC_PRTP
(
"- Checking cut containment "
,
p
->
timeCompare
,
p
->
timeTotal
);
ABC_PRTP
(
"- Checking cut containment "
,
p
->
timeCompare
,
p
->
timeTotal
);
ABC_PRTP
(
"- Adding cuts to storage "
,
p
->
timeStore
,
p
->
timeTotal
);
ABC_PRTP
(
"- Adding cuts to storage "
,
p
->
timeStore
,
p
->
timeTotal
);
ABC_PRTP
(
"Other "
,
p
->
timeOther
,
p
->
timeTotal
);
ABC_PRTP
(
"Other "
,
p
->
timeOther
,
p
->
timeTotal
);
ABC_PRTP
(
"TOTAL "
,
p
->
timeTotal
,
p
->
timeTotal
);
ABC_PRTP
(
"TOTAL "
,
p
->
timeTotal
,
p
->
timeTotal
);
#else
}
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
p
->
timeTotal
);
else
#endif
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
p
->
timeTotal
);
}
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
...
src/map/mpm/mpmMap.c
View file @
9e723d40
...
@@ -26,6 +26,8 @@ ABC_NAMESPACE_IMPL_START
...
@@ -26,6 +26,8 @@ ABC_NAMESPACE_IMPL_START
/// DECLARATIONS ///
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
#define MIG_RUNTIME
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
@@ -115,41 +117,22 @@ static inline void Mpm_CutPrintAll( Mpm_Man_t * p )
...
@@ -115,41 +117,22 @@ static inline void Mpm_CutPrintAll( Mpm_Man_t * p )
Mpm_CutPrint
(
&
p
->
pCutStore
[
i
]
->
pCut
);
Mpm_CutPrint
(
&
p
->
pCutStore
[
i
]
->
pCut
);
}
}
}
}
static
inline
int
Mpm_
Man
FindLeaf
(
Mpm_Cut_t
*
pNew
,
int
iObj
)
static
inline
int
Mpm_
Cut
FindLeaf
(
Mpm_Cut_t
*
pNew
,
int
iObj
)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
(
int
)
pNew
->
nLeaves
;
i
++
)
for
(
i
=
0
;
i
<
(
int
)
pNew
->
nLeaves
;
i
++
)
if
(
Abc_Lit2Var
(
pNew
->
pLeaves
[
i
])
==
iObj
)
if
(
Abc_Lit2Var
(
pNew
->
pLeaves
[
i
])
==
iObj
)
return
i
;
return
i
;
return
0xFF
;
return
i
;
}
}
static
inline
int
Mpm_
ManSetIsSmaller
(
Mpm_Man_t
*
p
,
Mpm_Cut_t
*
pNew
,
Mpm_Cut_t
*
pCut
,
int
nTotal
)
// check if pCut is contained in the current on
e
static
inline
int
Mpm_
CutIsContained
(
Mpm_Man_t
*
p
,
Mpm_Cut_t
*
pBase
,
Mpm_Cut_t
*
pCut
)
// check if pCut is contained pBas
e
{
{
int
i
,
Index
;
int
i
;
for
(
i
=
0
;
i
<
(
int
)
pCut
->
nLeaves
;
i
++
)
for
(
i
=
0
;
i
<
(
int
)
pCut
->
nLeaves
;
i
++
)
{
if
(
Mpm_CutFindLeaf
(
pBase
,
Abc_Lit2Var
(
pCut
->
pLeaves
[
i
])
)
==
(
int
)
pBase
->
nLeaves
)
// Index = (int)p->pObjPres[Abc_Lit2Var(pCut->pLeaves[i])];
Index
=
Mpm_ManFindLeaf
(
pNew
,
Abc_Lit2Var
(
pCut
->
pLeaves
[
i
])
);
if
(
Index
==
0xFF
)
return
0
;
return
0
;
// assert( Index < nTotal );
}
return
1
;
return
1
;
}
}
static
inline
int
Mpm_ManSetIsBigger
(
Mpm_Man_t
*
p
,
Mpm_Cut_t
*
pNew
,
Mpm_Cut_t
*
pCut
,
int
nTotal
)
// check if pCut contains the current one
{
int
i
,
Index
,
Counter
=
0
;
for
(
i
=
0
;
i
<
(
int
)
pCut
->
nLeaves
;
i
++
)
{
// Index = (int)p->pObjPres[Abc_Lit2Var(pCut->pLeaves[i])];
Index
=
Mpm_ManFindLeaf
(
pNew
,
Abc_Lit2Var
(
pCut
->
pLeaves
[
i
])
);
if
(
Index
==
0xFF
)
continue
;
// assert( Index < nTotal );
Counter
++
;
}
return
(
int
)(
Counter
==
nTotal
);
}
/**Function*************************************************************
/**Function*************************************************************
...
@@ -222,6 +205,9 @@ static inline Mpm_Uni_t * Mpm_CutSetupInfo( Mpm_Man_t * p, Mpm_Cut_t * pCut, int
...
@@ -222,6 +205,9 @@ 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
/
Abc_MaxInt
(
pCut
->
nLeaves
,
1
);
pUnit
->
mAveRefs
=
pUnit
->
mAveRefs
*
MPM_UNIT_EDGE
/
Abc_MaxInt
(
pCut
->
nLeaves
,
1
);
assert
(
pUnit
->
mTime
<=
0x3FFFFFFF
);
assert
(
pUnit
->
mArea
<=
0x3FFFFFFF
);
assert
(
pUnit
->
mEdge
<=
0x3FFFFFFF
);
return
pUnit
;
return
pUnit
;
}
}
...
@@ -278,7 +264,7 @@ clk = Abc_Clock();
...
@@ -278,7 +264,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
,
&
pUnitNew
->
pCut
,
&
pUnit
->
pCut
,
pUnitNew
->
pCut
.
nLeaves
)
)
Mpm_
CutIsContained
(
p
,
&
pUnitNew
->
pCut
,
&
pUnit
->
pCut
)
)
{
{
#ifdef MIG_RUNTIME
#ifdef MIG_RUNTIME
p
->
timeCompare
+=
Abc_Clock
()
-
clk
;
p
->
timeCompare
+=
Abc_Clock
()
-
clk
;
...
@@ -310,7 +296,7 @@ p->timeCompare += Abc_Clock() - clk;
...
@@ -310,7 +296,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
,
&
pUnitNew
->
pCut
,
&
pUnit
->
pCut
,
pUnitNew
->
pCut
.
nLeaves
)
)
Mpm_
CutIsContained
(
p
,
&
pUnit
->
pCut
,
&
pUnitNew
->
pCut
)
)
{
{
Vec_PtrPush
(
&
p
->
vFreeUnits
,
pUnit
);
Vec_PtrPush
(
&
p
->
vFreeUnits
,
pUnit
);
continue
;
continue
;
...
@@ -344,7 +330,7 @@ p->timeCompare += Abc_Clock() - clk;
...
@@ -344,7 +330,7 @@ p->timeCompare += Abc_Clock() - clk;
static
inline
Mpm_Cut_t
*
Mpm_ManMergeCuts
(
Mpm_Man_t
*
p
,
Mpm_Cut_t
*
pCut0
,
Mpm_Cut_t
*
pCut1
,
Mpm_Cut_t
*
pCut2
)
static
inline
Mpm_Cut_t
*
Mpm_ManMergeCuts
(
Mpm_Man_t
*
p
,
Mpm_Cut_t
*
pCut0
,
Mpm_Cut_t
*
pCut1
,
Mpm_Cut_t
*
pCut2
)
{
{
Mpm_Cut_t
*
pTemp
,
*
pCut
=
&
((
Mpm_Uni_t
*
)
Vec_PtrEntryLast
(
&
p
->
vFreeUnits
))
->
pCut
;
Mpm_Cut_t
*
pTemp
,
*
pCut
=
&
((
Mpm_Uni_t
*
)
Vec_PtrEntryLast
(
&
p
->
vFreeUnits
))
->
pCut
;
int
i
,
c
,
i
Obj
,
i
Place
;
int
i
,
c
,
iPlace
;
// base cut
// base cut
memcpy
(
pCut
->
pLeaves
,
pCut0
->
pLeaves
,
sizeof
(
int
)
*
pCut0
->
nLeaves
);
memcpy
(
pCut
->
pLeaves
,
pCut0
->
pLeaves
,
sizeof
(
int
)
*
pCut0
->
nLeaves
);
pCut
->
nLeaves
=
pCut0
->
nLeaves
;
pCut
->
nLeaves
=
pCut0
->
nLeaves
;
...
@@ -360,10 +346,7 @@ static inline Mpm_Cut_t * Mpm_ManMergeCuts( Mpm_Man_t * p, Mpm_Cut_t * pCut0, Mp
...
@@ -360,10 +346,7 @@ static inline Mpm_Cut_t * Mpm_ManMergeCuts( Mpm_Man_t * p, Mpm_Cut_t * pCut0, Mp
p
->
uComplMask
[
c
]
=
0
;
p
->
uComplMask
[
c
]
=
0
;
for
(
i
=
0
;
i
<
(
int
)
pTemp
->
nLeaves
;
i
++
)
for
(
i
=
0
;
i
<
(
int
)
pTemp
->
nLeaves
;
i
++
)
{
{
iObj
=
Abc_Lit2Var
(
pTemp
->
pLeaves
[
i
]);
iPlace
=
Mpm_CutFindLeaf
(
pCut
,
Abc_Lit2Var
(
pTemp
->
pLeaves
[
i
])
);
for
(
iPlace
=
0
;
iPlace
<
(
int
)
pCut
->
nLeaves
;
iPlace
++
)
if
(
iObj
==
Abc_Lit2Var
(
pCut
->
pLeaves
[
iPlace
])
)
break
;
if
(
iPlace
==
(
int
)
pCut
->
nLeaves
)
if
(
iPlace
==
(
int
)
pCut
->
nLeaves
)
{
{
if
(
(
int
)
pCut
->
nLeaves
==
p
->
nLutSize
)
if
(
(
int
)
pCut
->
nLeaves
==
p
->
nLutSize
)
...
@@ -385,10 +368,7 @@ static inline Mpm_Cut_t * Mpm_ManMergeCuts( Mpm_Man_t * p, Mpm_Cut_t * pCut0, Mp
...
@@ -385,10 +368,7 @@ static inline Mpm_Cut_t * Mpm_ManMergeCuts( Mpm_Man_t * p, Mpm_Cut_t * pCut0, Mp
break
;
break
;
for
(
i
=
0
;
i
<
(
int
)
pTemp
->
nLeaves
;
i
++
)
for
(
i
=
0
;
i
<
(
int
)
pTemp
->
nLeaves
;
i
++
)
{
{
iObj
=
Abc_Lit2Var
(
pTemp
->
pLeaves
[
i
]);
iPlace
=
Mpm_CutFindLeaf
(
pCut
,
Abc_Lit2Var
(
pTemp
->
pLeaves
[
i
])
);
for
(
iPlace
=
0
;
iPlace
<
(
int
)
pCut
->
nLeaves
;
iPlace
++
)
if
(
iObj
==
Abc_Lit2Var
(
pCut
->
pLeaves
[
iPlace
])
)
break
;
if
(
iPlace
==
(
int
)
pCut
->
nLeaves
)
if
(
iPlace
==
(
int
)
pCut
->
nLeaves
)
{
{
if
(
(
int
)
pCut
->
nLeaves
==
p
->
nLutSize
)
if
(
(
int
)
pCut
->
nLeaves
==
p
->
nLutSize
)
...
...
src/map/mpm/mpmMig.h
View file @
9e723d40
...
@@ -34,7 +34,6 @@ ABC_NAMESPACE_HEADER_START
...
@@ -34,7 +34,6 @@ ABC_NAMESPACE_HEADER_START
/// PARAMETERS ///
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
//#define MIG_RUNTIME
#define MIG_NONE 0x7FFFFFFF
#define MIG_NONE 0x7FFFFFFF
//#define MIG_MASK 0x0000FFFF
//#define MIG_MASK 0x0000FFFF
//#define MIG_BASE 16
//#define MIG_BASE 16
...
...
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