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
37107a3b
Commit
37107a3b
authored
Oct 25, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added new API to traverse the cut in the mapper.
parent
fac39766
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
1 deletions
+55
-1
src/map/if/if.h
+1
-0
src/map/if/ifMap.c
+3
-1
src/map/if/ifUtil.c
+51
-0
No files found.
src/map/if/if.h
View file @
37107a3b
...
...
@@ -525,6 +525,7 @@ extern Vec_Ptr_t * If_ManCollectMappingDirect( If_Man_t * p );
extern
Vec_Int_t
*
If_ManCollectMappingInt
(
If_Man_t
*
p
);
extern
int
If_ManCountSpecialPos
(
If_Man_t
*
p
);
extern
void
If_CutTraverse
(
If_Man_t
*
p
,
If_Obj_t
*
pRoot
,
If_Cut_t
*
pCut
,
Vec_Ptr_t
*
vNodes
);
/*=== abcRec.c ============================================================*/
extern
int
If_CutDelayRecCost
(
If_Man_t
*
p
,
If_Cut_t
*
pCut
,
If_Obj_t
*
pObj
);
...
...
src/map/if/ifMap.c
View file @
37107a3b
...
...
@@ -75,7 +75,8 @@ float If_CutDelaySpecial( If_Man_t * p, If_Cut_t * pCut, int fCarry )
Delay
=
IF_MAX
(
Delay
,
Pin2Pin
[
fCarry
][
i
]
+
DelayCur
);
}
return
Delay
;
}
}
/**Function*************************************************************
...
...
@@ -263,6 +264,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
pCut
->
AveRefs
=
(
Mode
==
0
)
?
(
float
)
0
.
0
:
If_CutAverageRefs
(
p
,
pCut
);
// insert the cut into storage
If_CutSort
(
p
,
pCutSet
,
pCut
);
// If_CutTraverse( p, pObj, pCut );
}
assert
(
pCutSet
->
nCuts
>
0
);
...
...
src/map/if/ifUtil.c
View file @
37107a3b
...
...
@@ -769,6 +769,57 @@ int If_ManCountSpecialPos( If_Man_t * p )
}
/**Function*************************************************************
Synopsis [Traverse the cut and counts its volume.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
void
If_CutTraverse_rec
(
If_Obj_t
*
pNode
,
Vec_Ptr_t
*
vNodes
)
{
if
(
pNode
->
fMark
)
return
;
pNode
->
fMark
=
1
;
// assert( !If_ObjIsCi(pNode) ); // does not hold with cut minimization
if
(
If_ObjIsAnd
(
pNode
)
)
If_CutTraverse_rec
(
If_ObjFanin0
(
pNode
),
vNodes
);
if
(
If_ObjIsAnd
(
pNode
)
)
If_CutTraverse_rec
(
If_ObjFanin1
(
pNode
),
vNodes
);
Vec_PtrPush
(
vNodes
,
pNode
);
}
void
If_CutTraverse
(
If_Man_t
*
p
,
If_Obj_t
*
pRoot
,
If_Cut_t
*
pCut
,
Vec_Ptr_t
*
vNodes
)
{
If_Obj_t
*
pLeaf
;
int
i
;
// collect the internal nodes of the cut
Vec_PtrClear
(
vNodes
);
If_CutForEachLeaf
(
p
,
pCut
,
pLeaf
,
i
)
{
Vec_PtrPush
(
vNodes
,
pLeaf
);
assert
(
pLeaf
->
fMark
==
0
);
pLeaf
->
fMark
=
1
;
}
// collect other nodes
If_CutTraverse_rec
(
pRoot
,
vNodes
);
// clean the mark
Vec_PtrForEachEntry
(
If_Obj_t
*
,
vNodes
,
pLeaf
,
i
)
pLeaf
->
fMark
=
0
;
}
void
If_CutTraverseTest
(
If_Man_t
*
p
,
If_Obj_t
*
pRoot
,
If_Cut_t
*
pCut
)
{
Vec_Ptr_t
*
vNodes
;
vNodes
=
Vec_PtrAlloc
(
1000
);
If_CutTraverse
(
p
,
pRoot
,
pCut
,
vNodes
);
//if ( Vec_PtrSize(vNodes) > 30 )
//printf( "%d ", Vec_PtrSize(vNodes) );
Vec_PtrFree
(
vNodes
);
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...
...
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