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
eb5c12a9
Commit
eb5c12a9
authored
Jul 17, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New technology mapper.
parent
bbbfe0e8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
24 deletions
+46
-24
src/map/mpm/mpmCore.c
+0
-2
src/map/mpm/mpmDsd.c
+1
-1
src/map/mpm/mpmGates.c
+43
-19
src/map/mpm/mpmInt.h
+1
-1
src/map/mpm/mpmMan.c
+1
-1
No files found.
src/map/mpm/mpmCore.c
View file @
eb5c12a9
...
...
@@ -79,8 +79,6 @@ Gia_Man_t * Mpm_ManPerformLutMapping( Mig_Man_t * pMig, Mpm_Par_t * pPars )
p
=
Mpm_ManStart
(
pMig
,
pPars
);
if
(
p
->
pPars
->
fVerbose
)
Mpm_ManPrintStatsInit
(
p
);
// if ( p->pPars->fMap4Gates )
// p->vGateNpnConfig = Mpm_ManFindDsdMatches( p, p->pPars->pScl, &p->vNpnCosts );
Mpm_ManPrepare
(
p
);
Mpm_ManPerform
(
p
);
if
(
p
->
pPars
->
fVerbose
)
...
...
src/map/mpm/mpmDsd.c
View file @
eb5c12a9
...
...
@@ -986,7 +986,7 @@ Kit_DsdPrintFromTruth( (unsigned *)&t, 6 ); printf( "\n" );
// check if the gate exists
if
(
p
->
pPars
->
fMap4Gates
)
{
if
(
Vec_IntEntry
(
p
->
v
GateNpnConfig
,
iClass
)
<
0
)
if
(
Vec_IntEntry
(
p
->
v
NpnConfigs
,
iClass
)
<
0
)
{
p
->
nNoMatch
++
;
return
0
;
...
...
src/map/mpm/mpmGates.c
View file @
eb5c12a9
...
...
@@ -100,19 +100,24 @@ Vec_Int_t * Mpm_ManFindDsdMatches( Mpm_Man_t * p, void * pScl, Vec_Int_t ** pvNp
SeeAlso []
***********************************************************************/
Vec_Ptr_t
*
Mpm_ManFindCells
(
Mio_Library_t
*
pMio
,
SC_Lib
*
pScl
,
Vec_Int_t
*
vNpn
Gate
s
)
Vec_Ptr_t
*
Mpm_ManFindCells
(
Mio_Library_t
*
pMio
,
SC_Lib
*
pScl
,
Vec_Int_t
*
vNpn
Config
s
)
{
Vec_Ptr_t
*
vNpnGatesMio
;
Mio_Gate_t
*
pMioGate
;
SC_Cell
*
pCell
;
int
iCell
,
iClass
;
vNpnGatesMio
=
Vec_PtrStart
(
Vec_IntSize
(
vNpn
Gate
s
)
);
Vec_IntForEachEntry
(
vNpn
Gates
,
iCell
,
iClass
)
int
Config
,
iClass
;
vNpnGatesMio
=
Vec_PtrStart
(
Vec_IntSize
(
vNpn
Config
s
)
);
Vec_IntForEachEntry
(
vNpn
Configs
,
Config
,
iClass
)
{
if
(
iCell
==
-
1
)
if
(
Config
==
-
1
)
continue
;
pCell
=
SC_LibCell
(
pScl
,
(
iCell
>>
17
)
);
pCell
=
SC_LibCell
(
pScl
,
(
Config
>>
17
)
);
pMioGate
=
Mio_LibraryReadGateByName
(
pMio
,
pCell
->
pName
,
NULL
);
if
(
pMioGate
==
NULL
)
{
Vec_PtrFree
(
vNpnGatesMio
);
return
NULL
;
}
assert
(
pMioGate
!=
NULL
);
Vec_PtrWriteEntry
(
vNpnGatesMio
,
iClass
,
pMioGate
);
}
...
...
@@ -160,10 +165,15 @@ Abc_Ntk_t * Mpm_ManDeriveMappedAbcNtk( Mpm_Man_t * p, Mio_Library_t * pMio )
Abc_Obj_t
*
pObj
,
*
pFanin
;
Mig_Obj_t
*
pNode
;
Mpm_Cut_t
*
pCutBest
;
int
i
,
k
,
iNode
,
iMigLit
,
fCompl
;
int
i
,
k
,
iNode
,
iMigLit
,
fCompl
,
Config
;
// find mapping of SCL cells into MIO cells
vNpnGatesMio
=
Mpm_ManFindCells
(
pMio
,
(
SC_Lib
*
)
p
->
pPars
->
pScl
,
p
->
vGateNpnConfig
);
vNpnGatesMio
=
Mpm_ManFindCells
(
pMio
,
(
SC_Lib
*
)
p
->
pPars
->
pScl
,
p
->
vNpnConfigs
);
if
(
vNpnGatesMio
==
NULL
)
{
printf
(
"Genlib library does not match SCL library.
\n
"
);
return
NULL
;
}
// create mapping for each phase of each node
vCopy
=
Vec_IntStartFull
(
2
*
Mig_ManObjNum
(
p
->
pMig
)
);
...
...
@@ -185,25 +195,39 @@ Abc_Ntk_t * Mpm_ManDeriveMappedAbcNtk( Mpm_Man_t * p, Mio_Library_t * pMio )
Abc_NtkAddDummyPiNames
(
pNtk
);
// create constant nodes
pObj
=
Abc_NtkCreateNodeConst0
(
pNtk
);
Vec_IntWriteEntry
(
vCopy
,
Abc_Var2Lit
(
0
,
0
),
Abc_ObjId
(
pObj
)
);
pObj
=
Abc_NtkCreateNodeConst1
(
pNtk
);
Vec_IntWriteEntry
(
vCopy
,
Abc_Var2Lit
(
0
,
1
),
Abc_ObjId
(
pObj
)
);
Mig_ManForEachCo
(
p
->
pMig
,
pNode
,
i
)
if
(
Mig_ObjFaninLit
(
pNode
,
0
)
==
0
)
{
pObj
=
Abc_NtkCreateNodeConst0
(
pNtk
);
Vec_IntWriteEntry
(
vCopy
,
Abc_Var2Lit
(
0
,
0
),
Abc_ObjId
(
pObj
)
);
break
;
}
Mig_ManForEachCo
(
p
->
pMig
,
pNode
,
i
)
if
(
Mig_ObjFaninLit
(
pNode
,
0
)
==
1
)
{
pObj
=
Abc_NtkCreateNodeConst1
(
pNtk
);
Vec_IntWriteEntry
(
vCopy
,
Abc_Var2Lit
(
0
,
1
),
Abc_ObjId
(
pObj
)
);
break
;
}
// create internal nodes
Vec_IntForEachEntry
(
vNodes
,
iNode
,
i
)
{
p
Node
=
Mig_ManObj
(
p
->
pMig
,
iNode
);
pCutBest
=
Mpm_ObjCutBestP
(
p
,
pNode
);
p
CutBest
=
Mpm_ObjCutBestP
(
p
,
Mig_ManObj
(
p
->
pMig
,
iNode
)
);
Config
=
Vec_IntEntry
(
p
->
vNpnConfigs
,
Abc_Lit2Var
(
pCutBest
->
iFunc
)
);
pObj
=
Abc_NtkCreateNode
(
pNtk
);
pObj
->
pData
=
Vec_PtrEntry
(
vNpnGatesMio
,
Abc_Lit2Var
(
pCutBest
->
iFunc
)
);
fCompl
=
Abc_LitIsCompl
(
pCutBest
->
iFunc
);
Mpm_CutForEachLeafLit
(
pCutBest
,
iMigLit
,
k
)
assert
(
pObj
->
pData
!=
NULL
);
fCompl
=
Abc_LitIsCompl
(
pCutBest
->
iFunc
)
^
((
Config
>>
16
)
&
1
);
Config
&=
0xFFFF
;
for
(
k
=
0
;
k
<
(
int
)
pCutBest
->
nLeaves
;
k
++
)
{
pFanin
=
Mpm_ManGetAbcNode
(
pNtk
,
vCopy
,
iMigLit
);
assert
(
(
Config
>>
6
)
<
720
);
iMigLit
=
pCutBest
->
pLeaves
[
(
int
)(
p
->
Perm6
[
Config
>>
6
][
k
])
];
pFanin
=
Mpm_ManGetAbcNode
(
pNtk
,
vCopy
,
Abc_LitNotCond
(
iMigLit
,
(
Config
>>
k
)
&
1
)
);
Abc_ObjAddFanin
(
pObj
,
pFanin
);
}
Vec_IntWriteEntry
(
vCopy
,
Abc_Var2Lit
(
iNode
,
fCompl
),
Abc_ObjId
(
pObj
)
);
Vec_IntWriteEntry
(
vCopy
,
Abc_Var2Lit
(
iNode
,
fCompl
),
Abc_ObjId
(
pObj
)
);
}
// create primary outputs
...
...
@@ -241,7 +265,7 @@ Abc_Ntk_t * Mpm_ManPerformCellMapping( Mig_Man_t * pMig, Mpm_Par_t * pPars, Mio_
p
=
Mpm_ManStart
(
pMig
,
pPars
);
if
(
p
->
pPars
->
fVerbose
)
Mpm_ManPrintStatsInit
(
p
);
p
->
v
GateNpnConfig
=
Mpm_ManFindDsdMatches
(
p
,
p
->
pPars
->
pScl
,
&
p
->
vNpnCosts
);
p
->
v
NpnConfigs
=
Mpm_ManFindDsdMatches
(
p
,
p
->
pPars
->
pScl
,
&
p
->
vNpnCosts
);
Mpm_ManPrepare
(
p
);
Mpm_ManPerform
(
p
);
if
(
p
->
pPars
->
fVerbose
)
...
...
src/map/mpm/mpmInt.h
View file @
eb5c12a9
...
...
@@ -140,7 +140,7 @@ struct Mpm_Man_t_
Vec_Int_t
*
vMap2Perm
;
// maps number into its permutation
unsigned
uPermMask
[
3
];
unsigned
uComplMask
[
3
];
Vec_Int_t
*
v
GateNpnConfig
;
Vec_Int_t
*
v
NpnConfigs
;
Vec_Int_t
*
vNpnCosts
;
// area cost of each NPN class
// mapping attributes
Vec_Int_t
vCutBests
;
// cut best
...
...
src/map/mpm/mpmMan.c
View file @
eb5c12a9
...
...
@@ -139,7 +139,7 @@ void Mpm_ManStop( Mpm_Man_t * p )
Hsh_IntManStop
(
p
->
pHash
);
}
Vec_IntFreeP
(
&
p
->
vNpnCosts
);
Vec_IntFreeP
(
&
p
->
v
GateNpnConfig
);
Vec_IntFreeP
(
&
p
->
v
NpnConfigs
);
Vec_PtrFree
(
p
->
vTemp
);
Mmr_StepStop
(
p
->
pManCuts
);
ABC_FREE
(
p
->
vObjPresUsed
.
pArray
);
...
...
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