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
fddff7a5
Commit
fddff7a5
authored
Jul 28, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Other changes to enable new features in the mapper (bug fix).
parent
8ed6d8e0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
167 additions
and
1 deletions
+167
-1
src/base/io/ioReadBlifMv.c
+167
-1
No files found.
src/base/io/ioReadBlifMv.c
View file @
fddff7a5
...
...
@@ -2150,7 +2150,7 @@ static inline int Abc_MapBox2Prev( Vec_Ptr_t * vDrivers, Vec_Int_t * vMapIn, Vec
SeeAlso []
***********************************************************************/
static
Vec_Vec_t
*
Io_MvExtractBoxInfo
(
Abc_Ntk_t
*
pNtk
)
static
Vec_Vec_t
*
Io_MvExtractBoxInfo
_
(
Abc_Ntk_t
*
pNtk
)
{
Vec_Int_t
*
vMapIn
,
*
vMapOut
,
*
vList
;
Vec_Ptr_t
*
vBoxInfo
,
*
vDrivers
;
...
...
@@ -2208,6 +2208,172 @@ static Vec_Vec_t * Io_MvExtractBoxInfo( Abc_Ntk_t * pNtk )
return
(
Vec_Vec_t
*
)
vBoxInfo
;
}
/**Function*************************************************************
Synopsis [Compares strings up to the first underscore.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Io_MvExtractCompareStr
(
char
*
pName1
,
char
*
pName2
)
{
while
(
*
pName1
&&
*
pName1
!=
'_'
&&
(
*
pName1
==
*
pName2
)
)
pName1
++
,
pName2
++
;
return
*
pName1
-
*
pName2
;
}
/**Function*************************************************************
Synopsis [Returns the first number of the string.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Io_MvExtractReadNum1
(
char
*
pName
)
{
while
(
*
pName
&&
(
*
pName
<
'0'
||
*
pName
>
'9'
)
)
pName
++
;
if
(
*
pName
==
0
)
return
-
1
;
return
atoi
(
pName
);
}
/**Function*************************************************************
Synopsis [Returns the second number of the string.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Io_MvExtractReadNum2
(
char
*
pName
)
{
int
Counter
=
0
;
while
(
*
pName
)
{
Counter
+=
(
*
pName
++
==
'_'
);
if
(
Counter
==
2
)
break
;
}
if
(
*
pName
==
0
)
return
-
1
;
return
atoi
(
pName
);
}
/**Function*************************************************************
Synopsis [Procedure used for sorting the nodes in decreasing order of levels.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Io_MvExtractCompareNames
(
Abc_Obj_t
**
pp1
,
Abc_Obj_t
**
pp2
)
{
char
*
pName1
=
(
char
*
)(
*
pp1
)
->
pCopy
;
char
*
pName2
=
(
char
*
)(
*
pp2
)
->
pCopy
;
// int Diff = Io_MvExtractReadNum1(pName1) - Io_MvExtractReadNum1(pName2);
int
Diff
=
Io_MvExtractCompareStr
(
pName1
,
pName2
);
if
(
Diff
<
0
)
return
-
1
;
if
(
Diff
>
0
)
return
1
;
Diff
=
Io_MvExtractReadNum2
(
pName1
)
-
Io_MvExtractReadNum2
(
pName2
);
if
(
Diff
<
0
)
return
-
1
;
if
(
Diff
>
0
)
return
1
;
return
0
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
Vec_Vec_t
*
Io_MvExtractBoxInfo
(
Abc_Ntk_t
*
pNtk
)
{
int
fVerbose
=
0
;
Vec_Vec_t
*
vBoxInfo
=
NULL
;
Vec_Ptr_t
*
vPetals
;
Abc_Obj_t
*
pObj
;
char
*
pPrev
,
*
pThis
;
int
i
,
Level
;
// quit if there is no boxes
if
(
pNtk
->
nRealPos
==
0
||
(
Abc_NtkPoNum
(
pNtk
)
-
pNtk
->
nRealPos
)
%
5
!=
0
)
return
NULL
;
// transfer names
Abc_NtkForEachPo
(
pNtk
,
pObj
,
i
)
{
pObj
->
pCopy
=
(
Abc_Obj_t
*
)
Abc_ObjName
(
Abc_ObjFanin0
(
pObj
)
);
pObj
->
iData
=
i
;
}
// collect POs
vPetals
=
Vec_PtrAlloc
(
Abc_NtkPoNum
(
pNtk
)
);
for
(
i
=
pNtk
->
nRealPos
;
i
<
Abc_NtkPoNum
(
pNtk
);
i
+=
5
)
Vec_PtrPush
(
vPetals
,
Abc_NtkPo
(
pNtk
,
i
)
);
// sort by name
qsort
(
(
void
*
)
Vec_PtrArray
(
vPetals
),
Vec_PtrSize
(
vPetals
),
sizeof
(
Abc_Obj_t
*
),
(
int
(
*
)(
const
void
*
,
const
void
*
))
Io_MvExtractCompareNames
);
// sort the POs
Level
=
-
1
;
pPrev
=
"dummy"
;
vBoxInfo
=
Vec_VecAlloc
(
32
);
Vec_PtrForEachEntry
(
Abc_Obj_t
*
,
vPetals
,
pObj
,
i
)
{
pThis
=
(
char
*
)
pObj
->
pCopy
;
if
(
Io_MvExtractCompareStr
(
pPrev
,
pThis
)
)
{
Level
++
;
if
(
fVerbose
)
printf
(
"
\n
"
);
}
Vec_VecPushInt
(
vBoxInfo
,
Level
,
pObj
->
iData
);
if
(
fVerbose
)
printf
(
"%s "
,
(
char
*
)
pObj
->
pCopy
);
pPrev
=
pThis
;
}
if
(
fVerbose
)
printf
(
"
\n
"
);
if
(
5
*
Vec_VecSizeSize
(
vBoxInfo
)
!=
(
Abc_NtkPoNum
(
pNtk
)
-
pNtk
->
nRealPos
)
)
printf
(
"Mismatch in the number of boxes!!!
\n
"
);
// clean up
Vec_PtrFree
(
vPetals
);
// remove names
Abc_NtkForEachPo
(
pNtk
,
pObj
,
i
)
{
pObj
->
pCopy
=
NULL
;
pObj
->
iData
=
0
;
}
return
vBoxInfo
;
}
////////////////////////////////////////////////////////////////////////
/// 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