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
5cd91450
Commit
5cd91450
authored
Apr 13, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New feature to optimize delay during mapping.
parent
e7d0c9dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
10 deletions
+45
-10
src/map/if/ifDelay.c
+40
-9
src/map/if/ifDsd.c
+5
-1
No files found.
src/map/if/ifDelay.c
View file @
5cd91450
...
...
@@ -289,15 +289,18 @@ int If_CutLutBalancePinDelays( If_Man_t * p, If_Cut_t * pCut, char * pPerm )
{
char
*
pCutPerm
=
If_CutDsdPerm
(
p
,
pCut
);
int
LutSize
=
p
->
pPars
->
pLutStruct
[
0
]
-
'0'
;
int
i
,
Delay
,
DelayMax
=
0
;
int
i
,
Delay
,
DelayMax
=
-
1
;
assert
(
(
If_CutLeaveNum
(
pCut
)
>
LutSize
)
==
(
pCut
->
uMaskFunc
>
0
)
);
for
(
i
=
0
;
i
<
If_CutLeaveNum
(
pCut
);
i
++
)
{
if
(
If_CutLeaveNum
(
pCut
)
>
LutSize
&&
((
pCut
->
uMaskFunc
>>
(
i
<<
2
))
&
1
)
)
pPerm
[
i
]
=
2
;
if
(
If_CutLeaveNum
(
pCut
)
>
LutSize
&&
((
pCut
->
uMaskFunc
>>
(
i
<<
1
))
&
1
)
)
pPerm
[
Abc_Lit2Var
((
int
)
pCutPerm
[
i
])
]
=
2
;
else
pPerm
[
i
]
=
1
;
Delay
=
(
int
)
If_ObjCutBest
(
If_CutLeaf
(
p
,
pCut
,
Abc_Lit2Var
(
pCutPerm
[
i
])))
->
Delay
;
pPerm
[
Abc_Lit2Var
((
int
)
pCutPerm
[
i
])]
=
1
;
}
for
(
i
=
0
;
i
<
If_CutLeaveNum
(
pCut
);
i
++
)
{
Delay
=
(
int
)
If_ObjCutBest
(
If_CutLeaf
(
p
,
pCut
,
i
))
->
Delay
;
DelayMax
=
Abc_MaxInt
(
DelayMax
,
Delay
+
(
int
)
pPerm
[
i
]
);
}
return
DelayMax
;
...
...
@@ -335,15 +338,15 @@ int If_CutLutBalanceEval( If_Man_t * p, If_Cut_t * pCut )
char
*
pCutPerm
=
If_CutDsdPerm
(
p
,
pCut
);
int
LutSize
=
p
->
pPars
->
pLutStruct
[
0
]
-
'0'
;
int
i
,
pTimes
[
IF_MAX_FUNC_LUTSIZE
];
int
DelayMax
=
0
,
nLeafMax
=
0
;
int
DelayMax
=
-
1
,
nLeafMax
=
0
;
unsigned
uLeafMask
=
0
;
for
(
i
=
0
;
i
<
If_CutLeaveNum
(
pCut
);
i
++
)
{
pTimes
[
i
]
=
(
int
)
If_ObjCutBest
(
If_CutLeaf
(
p
,
pCut
,
Abc_Lit2Var
(
pCutPerm
[
i
])))
->
Delay
;
pTimes
[
i
]
=
(
int
)
If_ObjCutBest
(
If_CutLeaf
(
p
,
pCut
,
Abc_Lit2Var
(
(
int
)
pCutPerm
[
i
])))
->
Delay
;
if
(
DelayMax
<
pTimes
[
i
]
)
DelayMax
=
pTimes
[
i
],
nLeafMax
=
1
,
uLeafMask
=
(
1
<<
(
i
<<
2
));
DelayMax
=
pTimes
[
i
],
nLeafMax
=
1
,
uLeafMask
=
(
1
<<
(
i
<<
1
));
else
if
(
DelayMax
==
pTimes
[
i
]
)
nLeafMax
++
,
uLeafMask
|=
(
1
<<
(
i
<<
2
));
nLeafMax
++
,
uLeafMask
|=
(
1
<<
(
i
<<
1
));
}
if
(
If_CutLeaveNum
(
pCut
)
<=
LutSize
)
return
DelayMax
+
1
;
...
...
@@ -355,9 +358,37 @@ int If_CutLutBalanceEval( If_Man_t * p, If_Cut_t * pCut )
return
DelayMax
+
1
;
}
pCut
->
uMaskFunc
=
If_DsdManCheckXY
(
p
->
pIfDsdMan
,
If_CutDsdLit
(
p
,
pCut
),
LutSize
,
1
,
0
,
0
,
0
);
if
(
pCut
->
uMaskFunc
==
0
)
return
-
1
;
return
DelayMax
+
2
;
}
}
/*
int If_CutLutBalanceEval( If_Man_t * p, If_Cut_t * pCut )
{
char pPerm[16];
int Delay2, Delay = If_CutLutBalanceEvalInt( p, pCut );
if ( Delay == -1 )
return -1;
Delay2 = If_CutLutBalancePinDelays( p, pCut, pPerm );
if ( Delay2 != Delay )
{
int s = 0;
char * pCutPerm = If_CutDsdPerm( p, pCut );
If_DsdManPrintNode( p->pIfDsdMan, If_CutDsdLit(p, pCut) ); Dau_DecPrintSet( pCut->uMaskFunc, pCut->nLeaves, 1 );
Kit_DsdPrintFromTruth( If_CutTruthUR(p, pCut), pCut->nLeaves ); printf( "\n" );
for ( s = 0; s < pCut->nLeaves; s++ )
// printf( "%d ", (int)If_ObjCutBest(If_CutLeaf(p, pCut, Abc_Lit2Var((int)pCutPerm[s])))->Delay );
printf( "%d ", (int)If_ObjCutBest(If_CutLeaf(p, pCut, s))->Delay );
printf( "\n" );
Delay = If_CutLutBalanceEvalInt( p, pCut );
Delay2 = If_CutLutBalancePinDelays( p, pCut, pPerm );
}
return Delay;
}
*/
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
...
...
src/map/if/ifDsd.c
View file @
5cd91450
...
...
@@ -1676,6 +1676,7 @@ unsigned If_DsdManCheckXY_int( If_DsdMan_t * p, int iDsd, int LutSize, int fDeri
{
If_DsdObj_t
*
pObj
,
*
pTemp
;
int
i
,
Mask
,
iFirst
;
unsigned
uRes
;
pObj
=
If_DsdVecObj
(
&
p
->
vObjs
,
Abc_Lit2Var
(
iDsd
)
);
if
(
fVerbose
)
If_DsdManPrintOne
(
stdout
,
p
,
Abc_Lit2Var
(
iDsd
),
NULL
,
0
);
...
...
@@ -1694,7 +1695,10 @@ unsigned If_DsdManCheckXY_int( If_DsdMan_t * p, int iDsd, int LutSize, int fDeri
if
(
fVerbose
)
If_DsdManPrintOne
(
stdout
,
p
,
pTemp
->
Id
,
NULL
,
1
);
iFirst
=
Vec_IntEntry
(
p
->
vTemp2
,
i
);
return
If_DsdSign_rec
(
p
,
pTemp
,
&
iFirst
);
uRes
=
If_DsdSign_rec
(
p
,
pTemp
,
&
iFirst
);
if
(
uRes
&
uMaskNot
)
continue
;
return
uRes
;
}
If_DsdVecForEachObjVec
(
p
->
vTemp1
,
&
p
->
vObjs
,
pTemp
,
i
)
if
(
(
If_DsdObjType
(
pTemp
)
==
IF_DSD_AND
||
If_DsdObjType
(
pTemp
)
==
IF_DSD_XOR
)
&&
If_DsdObjFaninNum
(
pTemp
)
>
2
&&
If_DsdObjSuppSize
(
pTemp
)
>
LutSize
)
...
...
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