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
51714ef6
Commit
51714ef6
authored
Aug 05, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding new (un)buffering with phase information.
parent
1a55882a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
src/map/scl/sclBuffer.c
+30
-5
No files found.
src/map/scl/sclBuffer.c
View file @
51714ef6
...
@@ -156,13 +156,30 @@ Abc_Ntk_t * Abc_SclUnBufferPerform( Abc_Ntk_t * pNtk, int fVerbose )
...
@@ -156,13 +156,30 @@ Abc_Ntk_t * Abc_SclUnBufferPerform( Abc_Ntk_t * pNtk, int fVerbose )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
int
Abc_SclCountMaxPhases
(
Abc_Ntk_t
*
pNtk
)
{
Vec_Int_t
*
vPhLevel
;
Abc_Obj_t
*
pObj
,
*
pFanin
;
int
i
,
k
,
Max
=
0
,
MaxAll
=
0
;
vPhLevel
=
Vec_IntStart
(
Abc_NtkObjNumMax
(
pNtk
)
);
Abc_NtkForEachNodeCo
(
pNtk
,
pObj
,
i
)
{
Max
=
0
;
Abc_ObjForEachFanin
(
pObj
,
pFanin
,
k
)
Max
=
Abc_MaxInt
(
Max
,
Vec_IntEntry
(
vPhLevel
,
Abc_ObjId
(
pFanin
))
+
Abc_ObjFaninPhase
(
pObj
,
k
)
);
Vec_IntWriteEntry
(
vPhLevel
,
i
,
Max
);
MaxAll
=
Abc_MaxInt
(
MaxAll
,
Max
);
}
Vec_IntFree
(
vPhLevel
);
return
MaxAll
;
}
Abc_Ntk_t
*
Abc_SclBufferPhase
(
Abc_Ntk_t
*
pNtk
,
int
fVerbose
)
Abc_Ntk_t
*
Abc_SclBufferPhase
(
Abc_Ntk_t
*
pNtk
,
int
fVerbose
)
{
{
Abc_Ntk_t
*
pNtkNew
;
Abc_Ntk_t
*
pNtkNew
;
Vec_Int_t
*
vInvs
;
Vec_Int_t
*
vInvs
;
Abc_Obj_t
*
pObj
,
*
pFanin
,
*
pFaninNew
;
Abc_Obj_t
*
pObj
,
*
pFanin
,
*
pFaninNew
;
int
nNodesOld
=
Abc_NtkObjNumMax
(
pNtk
);
int
nNodesOld
=
Abc_NtkObjNumMax
(
pNtk
);
int
i
,
k
,
Counter
=
0
;
int
i
,
k
,
Counter
=
0
,
Total
=
0
;
assert
(
pNtk
->
vPhases
!=
NULL
);
assert
(
pNtk
->
vPhases
!=
NULL
);
vInvs
=
Vec_IntStart
(
Abc_NtkObjNumMax
(
pNtk
)
);
vInvs
=
Vec_IntStart
(
Abc_NtkObjNumMax
(
pNtk
)
);
Abc_NtkForEachNodeCo
(
pNtk
,
pObj
,
i
)
Abc_NtkForEachNodeCo
(
pNtk
,
pObj
,
i
)
...
@@ -171,6 +188,7 @@ Abc_Ntk_t * Abc_SclBufferPhase( Abc_Ntk_t * pNtk, int fVerbose )
...
@@ -171,6 +188,7 @@ Abc_Ntk_t * Abc_SclBufferPhase( Abc_Ntk_t * pNtk, int fVerbose )
break
;
break
;
Abc_ObjForEachFanin
(
pObj
,
pFanin
,
k
)
Abc_ObjForEachFanin
(
pObj
,
pFanin
,
k
)
{
{
Total
++
;
if
(
!
Abc_ObjFaninPhase
(
pObj
,
k
)
)
if
(
!
Abc_ObjFaninPhase
(
pObj
,
k
)
)
continue
;
continue
;
if
(
Vec_IntEntry
(
vInvs
,
Abc_ObjId
(
pFanin
))
==
0
)
if
(
Vec_IntEntry
(
vInvs
,
Abc_ObjId
(
pFanin
))
==
0
)
...
@@ -183,7 +201,8 @@ Abc_Ntk_t * Abc_SclBufferPhase( Abc_Ntk_t * pNtk, int fVerbose )
...
@@ -183,7 +201,8 @@ Abc_Ntk_t * Abc_SclBufferPhase( Abc_Ntk_t * pNtk, int fVerbose )
Abc_ObjPatchFanin
(
pObj
,
pFanin
,
pFaninNew
);
Abc_ObjPatchFanin
(
pObj
,
pFanin
,
pFaninNew
);
}
}
}
}
// printf( "Added %d inverters.\n", Counter );
if
(
fVerbose
)
printf
(
"Added %d (%.2f %%) inverters.
\n
"
,
Counter
,
100
.
0
*
Counter
/
Total
);
Vec_IntFree
(
vInvs
);
Vec_IntFree
(
vInvs
);
Vec_IntFillExtra
(
pNtk
->
vPhases
,
Abc_NtkObjNumMax
(
pNtk
),
0
);
Vec_IntFillExtra
(
pNtk
->
vPhases
,
Abc_NtkObjNumMax
(
pNtk
),
0
);
// duplicate network in topo order
// duplicate network in topo order
...
@@ -195,8 +214,9 @@ Abc_Ntk_t * Abc_SclBufferPhase( Abc_Ntk_t * pNtk, int fVerbose )
...
@@ -195,8 +214,9 @@ Abc_Ntk_t * Abc_SclBufferPhase( Abc_Ntk_t * pNtk, int fVerbose )
}
}
Abc_Ntk_t
*
Abc_SclUnBufferPhase
(
Abc_Ntk_t
*
pNtk
,
int
fVerbose
)
Abc_Ntk_t
*
Abc_SclUnBufferPhase
(
Abc_Ntk_t
*
pNtk
,
int
fVerbose
)
{
{
Abc_Ntk_t
*
pNtkNew
;
Abc_Obj_t
*
pObj
,
*
pFanin
,
*
pFaninNew
;
Abc_Obj_t
*
pObj
,
*
pFanin
,
*
pFaninNew
;
int
i
,
k
,
iLit
,
Counter
=
0
;
int
i
,
k
,
iLit
,
Counter
=
0
,
Total
=
0
;
assert
(
pNtk
->
vPhases
==
NULL
);
assert
(
pNtk
->
vPhases
==
NULL
);
pNtk
->
vPhases
=
Vec_IntStart
(
Abc_NtkObjNumMax
(
pNtk
)
);
pNtk
->
vPhases
=
Vec_IntStart
(
Abc_NtkObjNumMax
(
pNtk
)
);
Abc_NtkForEachNodeCo
(
pNtk
,
pObj
,
i
)
Abc_NtkForEachNodeCo
(
pNtk
,
pObj
,
i
)
...
@@ -205,6 +225,7 @@ Abc_Ntk_t * Abc_SclUnBufferPhase( Abc_Ntk_t * pNtk, int fVerbose )
...
@@ -205,6 +225,7 @@ Abc_Ntk_t * Abc_SclUnBufferPhase( Abc_Ntk_t * pNtk, int fVerbose )
continue
;
continue
;
Abc_ObjForEachFanin
(
pObj
,
pFanin
,
k
)
Abc_ObjForEachFanin
(
pObj
,
pFanin
,
k
)
{
{
Total
++
;
iLit
=
Abc_SclGetRealFaninLit
(
pFanin
);
iLit
=
Abc_SclGetRealFaninLit
(
pFanin
);
pFaninNew
=
Abc_NtkObj
(
pNtk
,
Abc_Lit2Var
(
iLit
)
);
pFaninNew
=
Abc_NtkObj
(
pNtk
,
Abc_Lit2Var
(
iLit
)
);
if
(
pFaninNew
==
pFanin
)
if
(
pFaninNew
==
pFanin
)
...
@@ -217,9 +238,13 @@ Abc_Ntk_t * Abc_SclUnBufferPhase( Abc_Ntk_t * pNtk, int fVerbose )
...
@@ -217,9 +238,13 @@ Abc_Ntk_t * Abc_SclUnBufferPhase( Abc_Ntk_t * pNtk, int fVerbose )
Abc_ObjFaninFlipPhase
(
pObj
,
k
),
Counter
++
;
Abc_ObjFaninFlipPhase
(
pObj
,
k
),
Counter
++
;
}
}
}
}
// printf( "Saved %d fanin phase bits.\n", Counter );
if
(
fVerbose
)
printf
(
"Saved %d (%.2f %%) fanin phase bits. "
,
Counter
,
100
.
0
*
Counter
/
Total
);
// duplicate network in topo order
// duplicate network in topo order
return
Abc_NtkDupDfs
(
pNtk
);
pNtkNew
=
Abc_NtkDupDfs
(
pNtk
);
if
(
fVerbose
)
printf
(
"Max depth = %d.
\n
"
,
Abc_SclCountMaxPhases
(
pNtkNew
)
);
return
pNtkNew
;
}
}
/**Function*************************************************************
/**Function*************************************************************
...
...
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