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
ed4f4ade
Commit
ed4f4ade
authored
Dec 11, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the hierarchy printout.
parent
c2a1a9ef
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
0 deletions
+100
-0
src/base/abc/abcHie.c
+100
-0
No files found.
src/base/abc/abcHie.c
View file @
ed4f4ade
...
@@ -403,6 +403,103 @@ void Abc_NtkFlattenLogicHierarchy_rec( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, in
...
@@ -403,6 +403,103 @@ void Abc_NtkFlattenLogicHierarchy_rec( Abc_Ntk_t * pNtkNew, Abc_Ntk_t * pNtk, in
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Returns 0 if CI names are repeated.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_NtkCompareNames
(
Abc_Ntk_t
**
p1
,
Abc_Ntk_t
**
p2
)
{
return
strcmp
(
Abc_NtkName
(
*
p1
),
Abc_NtkName
(
*
p2
)
);
}
/**Function*************************************************************
Synopsis [Prints information about boxes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Abc_NtkPrintBoxInfo
(
Abc_Ntk_t
*
pNtk
)
{
Vec_Ptr_t
*
vMods
;
Abc_Ntk_t
*
pModel
,
*
pBoxModel
;
Abc_Obj_t
*
pObj
;
Vec_Int_t
*
vCounts
;
int
i
,
k
,
Num
;
if
(
pNtk
->
pDesign
==
NULL
||
pNtk
->
pDesign
->
vModules
==
NULL
)
{
printf
(
"There is no hierarchy information.
\n
"
);
return
;
}
// sort models by name
vMods
=
pNtk
->
pDesign
->
vModules
;
Vec_PtrSort
(
vMods
,
(
int
(
*
)())
Abc_NtkCompareNames
);
// Vec_PtrForEachEntry( Abc_Ntk_t *, vMods, pModel, i )
// printf( "%s\n", Abc_NtkName(pModel) );
// swap the first model
Num
=
Vec_PtrFind
(
vMods
,
pNtk
);
assert
(
Num
>=
0
&&
Num
<
Vec_PtrSize
(
vMods
)
);
pBoxModel
=
(
Abc_Ntk_t
*
)
Vec_PtrEntry
(
vMods
,
0
);
Vec_PtrWriteEntry
(
vMods
,
0
,
(
Abc_Ntk_t
*
)
Vec_PtrEntry
(
vMods
,
Num
)
);
Vec_PtrWriteEntry
(
vMods
,
Num
,
pBoxModel
);
// print models
vCounts
=
Vec_IntStart
(
Vec_PtrSize
(
vMods
)
);
Vec_PtrForEachEntry
(
Abc_Ntk_t
*
,
vMods
,
pModel
,
i
)
{
if
(
Abc_NtkBoxNum
(
pModel
)
==
0
)
continue
;
Vec_IntFill
(
vCounts
,
Vec_IntSize
(
vCounts
),
0
);
Abc_NtkForEachBox
(
pModel
,
pObj
,
k
)
{
pBoxModel
=
(
Abc_Ntk_t
*
)
pObj
->
pData
;
Num
=
Vec_PtrFind
(
vMods
,
pBoxModel
);
assert
(
Num
>=
0
&&
Num
<
Vec_PtrSize
(
vMods
)
);
Vec_IntAddToEntry
(
vCounts
,
Num
,
1
);
}
// Abc_NtkPrintStats( pModel, 0, 0, 0, 0, 0, 0, 0 );
printf
(
"MODULE "
);
printf
(
"%-30s : "
,
Abc_NtkName
(
pModel
)
);
printf
(
"PI=%6d "
,
Abc_NtkPiNum
(
pModel
)
);
printf
(
"PO=%6d "
,
Abc_NtkPoNum
(
pModel
)
);
printf
(
"BB=%6d "
,
Abc_NtkBoxNum
(
pModel
)
);
printf
(
"ND=%6d "
,
Abc_NtkNodeNum
(
pModel
)
-
2
);
// sans constants
printf
(
"Lev=%5d "
,
Abc_NtkLevel
(
pModel
)
);
printf
(
"
\n
"
);
Vec_IntForEachEntry
(
vCounts
,
Num
,
k
)
if
(
Num
)
printf
(
"%15d : %s
\n
"
,
Num
,
Abc_NtkName
((
Abc_Ntk_t
*
)
Vec_PtrEntry
(
vMods
,
k
))
);
}
Vec_IntFree
(
vCounts
);
Vec_PtrForEachEntry
(
Abc_Ntk_t
*
,
vMods
,
pModel
,
i
)
{
if
(
Abc_NtkBoxNum
(
pModel
)
!=
0
)
continue
;
printf
(
"MODULE "
);
printf
(
"%-30s : "
,
Abc_NtkName
(
pModel
)
);
printf
(
"PI=%6d "
,
Abc_NtkPiNum
(
pModel
)
);
printf
(
"PO=%6d "
,
Abc_NtkPoNum
(
pModel
)
);
printf
(
"BB=%6d "
,
Abc_NtkBoxNum
(
pModel
)
);
printf
(
"ND=%6d "
,
Abc_NtkNodeNum
(
pModel
)
);
printf
(
"Lev=%5d "
,
Abc_NtkLevel
(
pModel
)
);
printf
(
"
\n
"
);
}
}
/**Function*************************************************************
Synopsis [Flattens the logic hierarchy of the netlist.]
Synopsis [Flattens the logic hierarchy of the netlist.]
Description []
Description []
...
@@ -421,6 +518,9 @@ Abc_Ntk_t * Abc_NtkFlattenLogicHierarchy( Abc_Ntk_t * pNtk )
...
@@ -421,6 +518,9 @@ Abc_Ntk_t * Abc_NtkFlattenLogicHierarchy( Abc_Ntk_t * pNtk )
int
i
,
Counter
=
-
1
;
int
i
,
Counter
=
-
1
;
assert
(
Abc_NtkIsNetlist
(
pNtk
)
);
assert
(
Abc_NtkIsNetlist
(
pNtk
)
);
Abc_NtkPrintBoxInfo
(
pNtk
);
// start the network
// start the network
pNtkNew
=
Abc_NtkAlloc
(
pNtk
->
ntkType
,
pNtk
->
ntkFunc
,
1
);
pNtkNew
=
Abc_NtkAlloc
(
pNtk
->
ntkType
,
pNtk
->
ntkFunc
,
1
);
// duplicate the name and the spec
// duplicate the name and the spec
...
...
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