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
95e14cd7
Commit
95e14cd7
authored
Aug 26, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Select for mapping smallest-area gates for each functionality.
parent
889ed19c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
49 deletions
+16
-49
src/map/mio/mioUtils.c
+16
-49
No files found.
src/map/mio/mioUtils.c
View file @
95e14cd7
...
@@ -231,78 +231,45 @@ Mio_Gate_t ** Mio_CollectRoots( Mio_Library_t * pLib, int nInputs, float tDelay,
...
@@ -231,78 +231,45 @@ Mio_Gate_t ** Mio_CollectRoots( Mio_Library_t * pLib, int nInputs, float tDelay,
{
{
Mio_Gate_t
*
pGate
;
Mio_Gate_t
*
pGate
;
Mio_Gate_t
**
ppGates
;
Mio_Gate_t
**
ppGates
;
/* st_table * tFuncs; */
int
i
,
nGates
,
iGate
;
/* st_generator * gen; */
// DdNode * bFunc;
// DdManager * dd;
int
nGates
,
iGate
;
// dd = Mio_LibraryReadDd( pLib );
nGates
=
Mio_LibraryReadGateNum
(
pLib
);
nGates
=
Mio_LibraryReadGateNum
(
pLib
);
/*
// for each functionality select one gate; skip constants and buffers
tFuncs = st_init_table( st_ptrcmp, st_ptrhash );
Mio_LibraryForEachGate( pLib, pGate )
{
bFunc = Mio_GateReadFunc(pGate);
if ( pGate->nInputs > nInputs )
continue;
if ( pGate->dDelayMax > (double)tDelay )
continue;
if ( bFunc == b0 || bFunc == b1 )
continue;
if ( bFunc == dd->vars[0] )
continue;
if ( bFunc == Cudd_Not(dd->vars[0]) && fSkipInv )
continue;
if ( st_is_member( tFuncs, (char *)bFunc ) )
continue;
st_insert( tFuncs, (char *)bFunc, (char *)pGate );
}
// collect the gates into the array
ppGates = ABC_ALLOC( Mio_Gate_t *, nGates );
iGate = 0;
st_foreach_item( tFuncs, gen, (char **)&bFunc, (char **)&pGate )
ppGates[ iGate++ ] = pGate;
assert( iGate <= nGates );
st_free_table( tFuncs );
*/
ppGates
=
ABC_ALLOC
(
Mio_Gate_t
*
,
nGates
);
ppGates
=
ABC_ALLOC
(
Mio_Gate_t
*
,
nGates
);
iGate
=
0
;
iGate
=
0
;
// for each functionality, select gate with the smallest area
// if equal areas, select gate with lexicographically smaller name
Mio_LibraryForEachGate
(
pLib
,
pGate
)
Mio_LibraryForEachGate
(
pLib
,
pGate
)
{
{
// bFunc = Mio_GateReadFunc(pGate);
if
(
pGate
->
nInputs
>
nInputs
)
if
(
pGate
->
nInputs
>
nInputs
)
continue
;
continue
;
if
(
pGate
->
dDelayMax
>
(
double
)
tDelay
)
if
(
pGate
->
dDelayMax
>
(
double
)
tDelay
)
continue
;
continue
;
// if ( bFunc == b0 || bFunc == b1 )
if
(
pGate
->
uTruth
==
0
||
pGate
->
uTruth
==
~
0
)
if
(
pGate
->
uTruth
==
0
||
pGate
->
uTruth
==
~
0
)
continue
;
continue
;
// if ( bFunc == dd->vars[0] )
if
(
pGate
->
uTruth
==
0xAAAAAAAAAAAAAAAA
)
if
(
pGate
->
uTruth
==
0xAAAAAAAAAAAAAAAA
)
continue
;
continue
;
// if ( bFunc == Cudd_Not(dd->vars[0]) && fSkipInv )
if
(
pGate
->
uTruth
==
~
0xAAAAAAAAAAAAAAAA
&&
fSkipInv
)
if
(
pGate
->
uTruth
==
~
0xAAAAAAAAAAAAAAAA
&&
fSkipInv
)
continue
;
continue
;
// check if the gate with this functionality already exists
for
(
i
=
0
;
i
<
iGate
;
i
++
)
if
(
ppGates
[
i
]
->
uTruth
==
pGate
->
uTruth
)
{
if
(
ppGates
[
i
]
->
dArea
>
pGate
->
dArea
||
(
ppGates
[
i
]
->
dArea
==
pGate
->
dArea
&&
strcmp
(
ppGates
[
i
]
->
pName
,
pGate
->
pName
)
>
0
)
)
ppGates
[
i
]
=
pGate
;
break
;
}
if
(
i
<
iGate
)
continue
;
assert
(
iGate
<
nGates
);
assert
(
iGate
<
nGates
);
ppGates
[
iGate
++
]
=
pGate
;
ppGates
[
iGate
++
]
=
pGate
;
}
}
// sort by delay
if
(
iGate
>
0
)
if
(
iGate
>
0
)
{
{
// sort the gates by delay
qsort
(
(
void
*
)
ppGates
,
iGate
,
sizeof
(
Mio_Gate_t
*
),
qsort
(
(
void
*
)
ppGates
,
iGate
,
sizeof
(
Mio_Gate_t
*
),
(
int
(
*
)(
const
void
*
,
const
void
*
))
Mio_DelayCompare
);
(
int
(
*
)(
const
void
*
,
const
void
*
))
Mio_DelayCompare
);
assert
(
Mio_DelayCompare
(
ppGates
,
ppGates
+
iGate
-
1
)
<=
0
);
assert
(
Mio_DelayCompare
(
ppGates
,
ppGates
+
iGate
-
1
)
<=
0
);
}
}
if
(
pnGates
)
if
(
pnGates
)
*
pnGates
=
iGate
;
*
pnGates
=
iGate
;
return
ppGates
;
return
ppGates
;
...
...
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