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
4decece2
Commit
4decece2
authored
Jul 18, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New technology mapper.
parent
eb5c12a9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
13 deletions
+60
-13
src/map/mpm/mpmInt.h
+0
-1
src/map/mpm/mpmMan.c
+0
-2
src/map/mpm/mpmMap.c
+60
-10
No files found.
src/map/mpm/mpmInt.h
View file @
4decece2
...
...
@@ -116,7 +116,6 @@ struct Mpm_Man_t_
// object presence
unsigned
char
*
pObjPres
;
// object presence
Vec_Int_t
vObjPresUsed
;
// used objects
Vec_Str_t
vObjShared
;
// object presence
// cut comparison
int
(
*
pCutCmp
)
(
Mpm_Uni_t
*
,
Mpm_Uni_t
*
);
// procedure to compare cuts
// fanin cuts/signatures
...
...
src/map/mpm/mpmMan.c
View file @
4decece2
...
...
@@ -67,7 +67,6 @@ Mpm_Man_t * Mpm_ManStart( Mig_Man_t * pMig, Mpm_Par_t * pPars )
Vec_PtrPush
(
&
p
->
vFreeUnits
,
p
->
pCutUnits
+
i
);
p
->
pObjPres
=
ABC_FALLOC
(
unsigned
char
,
Mig_ManObjNum
(
pMig
)
);
Vec_IntGrow
(
&
p
->
vObjPresUsed
,
p
->
nLutSize
);
Vec_StrGrow
(
&
p
->
vObjShared
,
32
);
p
->
vTemp
=
Vec_PtrAlloc
(
1000
);
// mapping attributes
Vec_IntFill
(
&
p
->
vCutBests
,
Mig_ManObjNum
(
pMig
),
0
);
...
...
@@ -144,7 +143,6 @@ void Mpm_ManStop( Mpm_Man_t * p )
Mmr_StepStop
(
p
->
pManCuts
);
ABC_FREE
(
p
->
vObjPresUsed
.
pArray
);
ABC_FREE
(
p
->
vFreeUnits
.
pArray
);
ABC_FREE
(
p
->
vObjShared
.
pArray
);
ABC_FREE
(
p
->
pObjPres
);
// mapping attributes
ABC_FREE
(
p
->
vCutBests
.
pArray
);
...
...
src/map/mpm/mpmMap.c
View file @
4decece2
...
...
@@ -115,24 +115,34 @@ static inline void Mpm_CutPrintAll( Mpm_Man_t * p )
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
static
inline
int
Mpm_ManFindLeaf
(
Mpm_Cut_t
*
pNew
,
int
iObj
)
{
int
i
;
for
(
i
=
0
;
i
<
(
int
)
pNew
->
nLeaves
;
i
++
)
if
(
Abc_Lit2Var
(
pNew
->
pLeaves
[
i
])
==
iObj
)
return
i
;
return
0xFF
;
}
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 one
{
int
i
,
Index
;
for
(
i
=
0
;
i
<
(
int
)
pCut
->
nLeaves
;
i
++
)
{
Index
=
(
int
)
p
->
pObjPres
[
Abc_Lit2Var
(
pCut
->
pLeaves
[
i
])];
// Index = (int)p->pObjPres[Abc_Lit2Var(pCut->pLeaves[i])];
Index
=
Mpm_ManFindLeaf
(
pNew
,
Abc_Lit2Var
(
pCut
->
pLeaves
[
i
])
);
if
(
Index
==
0xFF
)
return
0
;
// assert( Index < nTotal );
}
return
1
;
}
static
inline
int
Mpm_ManSetIsBigger
(
Mpm_Man_t
*
p
,
Mpm_Cut_t
*
pCut
,
int
nTotal
)
// check if pCut contains the current one
static
inline
int
Mpm_ManSetIsBigger
(
Mpm_Man_t
*
p
,
Mpm_Cut_t
*
p
New
,
Mpm_Cut_t
*
p
Cut
,
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 = (int)p->pObjPres[Abc_Lit2Var(pCut->pLeaves[i])];
Index
=
Mpm_ManFindLeaf
(
pNew
,
Abc_Lit2Var
(
pCut
->
pLeaves
[
i
])
);
if
(
Index
==
0xFF
)
continue
;
// assert( Index < nTotal );
...
...
@@ -268,7 +278,7 @@ clk = Abc_Clock();
pUnit
=
p
->
pCutStore
[
k
];
if
(
pUnitNew
->
pCut
.
nLeaves
>=
pUnit
->
pCut
.
nLeaves
&&
(
pUnitNew
->
uSign
&
pUnit
->
uSign
)
==
pUnit
->
uSign
&&
Mpm_ManSetIsSmaller
(
p
,
&
pUnit
->
pCut
,
pUnitNew
->
pCut
.
nLeaves
)
)
Mpm_ManSetIsSmaller
(
p
,
&
pUnit
New
->
pCut
,
&
pUnit
->
pCut
,
pUnitNew
->
pCut
.
nLeaves
)
)
{
#ifdef MIG_RUNTIME
p
->
timeCompare
+=
Abc_Clock
()
-
clk
;
...
...
@@ -300,7 +310,7 @@ p->timeCompare += Abc_Clock() - clk;
pUnit
=
p
->
pCutStore
[
k
];
if
(
pUnitNew
->
pCut
.
nLeaves
<=
pUnit
->
pCut
.
nLeaves
&&
(
pUnitNew
->
uSign
&
pUnit
->
uSign
)
==
pUnitNew
->
uSign
&&
Mpm_ManSetIsBigger
(
p
,
&
pUnit
->
pCut
,
pUnitNew
->
pCut
.
nLeaves
)
)
Mpm_ManSetIsBigger
(
p
,
&
pUnit
New
->
pCut
,
&
pUnit
->
pCut
,
pUnitNew
->
pCut
.
nLeaves
)
)
{
Vec_PtrPush
(
&
p
->
vFreeUnits
,
pUnit
);
continue
;
...
...
@@ -333,16 +343,19 @@ 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
)
{
int
fUsePres
=
0
;
Mpm_Cut_t
*
pTemp
,
*
pCut
=
&
((
Mpm_Uni_t
*
)
Vec_PtrEntryLast
(
&
p
->
vFreeUnits
))
->
pCut
;
int
i
,
c
,
iObj
,
fDisj
=
1
;
if
(
fUsePres
)
{
// clean present objects
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
);
// check present objects
// for ( i = 0; i < Mig_ManObjNum(p->pMig); i++ )
// assert( p->pObjPres[i] == (unsigned char)0xFF );
// for ( i = 0; i < Mig_ManObjNum(p->pMig); i++ )
// assert( p->pObjPres[i] == (unsigned char)0xFF );
// base cut
pCut
->
nLeaves
=
0
;
for
(
i
=
0
;
i
<
(
int
)
pCut0
->
nLeaves
;
i
++
)
...
...
@@ -378,7 +391,44 @@ static inline Mpm_Cut_t * Mpm_ManMergeCuts( Mpm_Man_t * p, Mpm_Cut_t * pCut0, Mp
if
(
pTemp
->
pLeaves
[
i
]
!=
pCut
->
pLeaves
[
p
->
pObjPres
[
iObj
]]
)
p
->
uComplMask
[
c
]
|=
(
1
<<
p
->
pObjPres
[
iObj
]);
}
// Mpm_ManPrintPerm( p->uPermMask[c] ); printf( "\n" );
// Mpm_ManPrintPerm( p->uPermMask[c] ); printf( "\n" );
}
}
else
{
int
iPlace
;
// base cut
pCut
->
nLeaves
=
0
;
for
(
i
=
0
;
i
<
(
int
)
pCut0
->
nLeaves
;
i
++
)
pCut
->
pLeaves
[
pCut
->
nLeaves
++
]
=
pCut0
->
pLeaves
[
i
];
// remaining cuts
for
(
c
=
1
;
c
<
3
;
c
++
)
{
pTemp
=
(
c
==
1
)
?
pCut1
:
pCut2
;
if
(
pTemp
==
NULL
)
break
;
p
->
uPermMask
[
c
]
=
0x3FFFF
;
// 18 bits
p
->
uComplMask
[
c
]
=
0
;
for
(
i
=
0
;
i
<
(
int
)
pTemp
->
nLeaves
;
i
++
)
{
iObj
=
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
(
(
int
)
pCut
->
nLeaves
==
p
->
nLutSize
)
return
NULL
;
pCut
->
pLeaves
[
pCut
->
nLeaves
++
]
=
pTemp
->
pLeaves
[
i
];
}
else
fDisj
=
0
;
p
->
uPermMask
[
c
]
^=
(((
i
&
7
)
^
7
)
<<
(
3
*
iPlace
));
assert
(
Abc_Lit2Var
(
pTemp
->
pLeaves
[
i
])
==
Abc_Lit2Var
(
pCut
->
pLeaves
[
iPlace
])
);
if
(
pTemp
->
pLeaves
[
i
]
!=
pCut
->
pLeaves
[
iPlace
]
)
p
->
uComplMask
[
c
]
|=
(
1
<<
iPlace
);
}
}
}
// printf( "%d", fDisj );
if
(
pCut1
==
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