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
7a3c33e1
Commit
7a3c33e1
authored
Jan 13, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New hierarchy manager.
parent
5fff8354
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
10 deletions
+53
-10
src/base/abc/abc.h
+1
-0
src/base/abc/abcHieCec.c
+49
-1
src/base/abc/abcHieNew.c
+3
-9
No files found.
src/base/abc/abc.h
View file @
7a3c33e1
...
...
@@ -194,6 +194,7 @@ struct Abc_Ntk_t_
short
fHieVisited
;
// flag to mark the visited network
short
fHiePath
;
// flag to mark the network on the path
int
Id
;
// model ID
double
dTemp
;
// temporary value
// miscellaneous data members
int
nTravIds
;
// the unique traversal IDs of nodes
Mem_Fixed_t
*
pMmObj
;
// memory manager for objects
...
...
src/base/abc/abcHieCec.c
View file @
7a3c33e1
...
...
@@ -532,7 +532,7 @@ int Abc_NtkCountInst_rec( Abc_Ntk_t * pNtk )
return
pNtk
->
iStep
;
vOrder
=
Abc_NtkDfsBoxes
(
pNtk
);
Vec_PtrForEachEntry
(
Abc_Obj_t
*
,
vOrder
,
pObj
,
i
)
if
(
Abc_ObjIsBox
(
pObj
)
)
if
(
Abc_ObjIsBox
(
pObj
)
&&
(
Abc_Ntk_t
*
)
pObj
->
pData
!=
pNtk
)
Counter
+=
Abc_NtkCountInst_rec
(
(
Abc_Ntk_t
*
)
pObj
->
pData
);
Vec_PtrFree
(
vOrder
);
return
pNtk
->
iStep
=
1
+
Counter
;
...
...
@@ -554,6 +554,50 @@ void Abc_NtkCountInst( Abc_Ntk_t * pNtk )
/**Function*************************************************************
Synopsis [Counts the number of nodes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
double
Abc_NtkCountNodes_rec
(
Abc_Ntk_t
*
pNtk
)
{
Vec_Ptr_t
*
vOrder
;
Abc_Obj_t
*
pObj
;
double
Counter
=
0
;
int
i
;
if
(
pNtk
->
dTemp
>=
0
)
return
pNtk
->
dTemp
;
vOrder
=
Abc_NtkDfsBoxes
(
pNtk
);
Vec_PtrForEachEntry
(
Abc_Obj_t
*
,
vOrder
,
pObj
,
i
)
if
(
Abc_ObjIsNode
(
pObj
)
)
Counter
++
;
else
if
(
Abc_ObjIsBox
(
pObj
)
&&
(
Abc_Ntk_t
*
)
pObj
->
pData
!=
pNtk
)
Counter
+=
Abc_NtkCountNodes_rec
(
(
Abc_Ntk_t
*
)
pObj
->
pData
);
Vec_PtrFree
(
vOrder
);
return
pNtk
->
dTemp
=
Counter
;
}
void
Abc_NtkCountNodes
(
Abc_Ntk_t
*
pNtk
)
{
Vec_Ptr_t
*
vMods
;
Abc_Ntk_t
*
pModel
;
double
Counter
;
int
i
;
vMods
=
pNtk
->
pDesign
->
vModules
;
Vec_PtrForEachEntry
(
Abc_Ntk_t
*
,
vMods
,
pModel
,
i
)
pModel
->
dTemp
=
-
1
;
Counter
=
Abc_NtkCountNodes_rec
(
pNtk
);
printf
(
"Nodes = %.0f
\n
"
,
Counter
);
}
/**Function*************************************************************
Synopsis [Checks if there is a recursive definition.]
Description []
...
...
@@ -626,6 +670,10 @@ Gia_Man_t * Abc_NtkHieCecTest( char * pFileName, int fVerbose )
assert
(
Abc_NtkIsNetlist
(
pNtk
)
);
assert
(
!
Abc_NtkLatchNum
(
pNtk
)
);
clk
=
clock
();
Abc_NtkCountNodes
(
pNtk
);
Abc_PrintTime
(
1
,
"Count nodes"
,
clock
()
-
clk
);
// print stats
if
(
fVerbose
)
Abc_NtkPrintBoxInfo
(
pNtk
);
...
...
src/base/abc/abcHieNew.c
View file @
7a3c33e1
...
...
@@ -365,15 +365,9 @@ int Au_NtkAllocObj( Au_Ntk_t * p, int nFanins, int Type )
{
Au_Obj_t
*
pMem
,
*
pObj
,
*
pTemp
;
int
Id
,
nObjInt
=
((
2
+
nFanins
)
>>
2
)
+
(((
2
+
nFanins
)
&
3
)
>
0
);
int
nObjIntReal
=
nObjInt
;
if
(
nObjInt
>
63
)
{
int
nObjInt2
=
63
+
64
*
(((
nObjInt
-
63
)
>>
6
)
+
(((
nObjInt
-
63
)
&
63
)
>
0
));
assert
(
nObjInt2
>=
nObjInt
);
// if ( nObjInt2 + 64 < (1 << 12) )
// p->nUseful += nObjInt - nObjInt2;
nObjInt
=
nObjInt2
;
}
nObjInt
=
63
+
64
*
(((
nObjInt
-
63
)
>>
6
)
+
(((
nObjInt
-
63
)
&
63
)
>
0
));
if
(
Vec_PtrSize
(
&
p
->
vPages
)
==
0
||
p
->
iHandle
+
nObjInt
>
(
1
<<
12
)
)
{
if
(
nObjInt
+
64
>
(
1
<<
12
)
)
...
...
@@ -421,7 +415,7 @@ int Au_NtkAllocObj( Au_Ntk_t * p, int nFanins, int Type )
Vec_IntPush
(
&
p
->
vPos
,
Au_ObjId
(
pObj
)
);
}
p
->
iHandle
+=
nObjInt
;
p
->
nUseful
+=
nObjInt
;
p
->
nUseful
+=
nObjInt
Real
;
p
->
nObjsUsed
++
;
Id
=
Au_ObjId
(
pObj
);
...
...
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