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
ac7e665b
Commit
ac7e665b
authored
Jan 14, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixes in the Verilog parser.
parent
c7e215ca
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
src/base/abc/abcHie.c
+3
-1
src/base/io/ioReadVerilog.c
+10
-4
src/base/ver/verCore.c
+2
-0
src/base/ver/verParse.c
+1
-1
No files found.
src/base/abc/abcHie.c
View file @
ac7e665b
...
@@ -463,6 +463,8 @@ void Abc_NtkPrintBoxInfo( Abc_Ntk_t * pNtk )
...
@@ -463,6 +463,8 @@ void Abc_NtkPrintBoxInfo( Abc_Ntk_t * pNtk )
Abc_NtkForEachBox
(
pModel
,
pObj
,
k
)
Abc_NtkForEachBox
(
pModel
,
pObj
,
k
)
{
{
pBoxModel
=
(
Abc_Ntk_t
*
)
pObj
->
pData
;
pBoxModel
=
(
Abc_Ntk_t
*
)
pObj
->
pData
;
if
(
pBoxModel
==
NULL
)
continue
;
Num
=
Vec_PtrFind
(
vMods
,
pBoxModel
);
Num
=
Vec_PtrFind
(
vMods
,
pBoxModel
);
assert
(
Num
>=
0
&&
Num
<
Vec_PtrSize
(
vMods
)
);
assert
(
Num
>=
0
&&
Num
<
Vec_PtrSize
(
vMods
)
);
Vec_IntAddToEntry
(
vCounts
,
Num
,
1
);
Vec_IntAddToEntry
(
vCounts
,
Num
,
1
);
...
@@ -474,7 +476,7 @@ void Abc_NtkPrintBoxInfo( Abc_Ntk_t * pNtk )
...
@@ -474,7 +476,7 @@ void Abc_NtkPrintBoxInfo( Abc_Ntk_t * pNtk )
printf
(
"PI=%6d "
,
Abc_NtkPiNum
(
pModel
)
);
printf
(
"PI=%6d "
,
Abc_NtkPiNum
(
pModel
)
);
printf
(
"PO=%6d "
,
Abc_NtkPoNum
(
pModel
)
);
printf
(
"PO=%6d "
,
Abc_NtkPoNum
(
pModel
)
);
printf
(
"BB=%6d "
,
Abc_NtkBoxNum
(
pModel
)
);
printf
(
"BB=%6d "
,
Abc_NtkBoxNum
(
pModel
)
);
printf
(
"ND=%6d "
,
Abc_NtkNodeNum
(
pModel
)
-
2
);
// sans constants
printf
(
"ND=%6d "
,
Abc_NtkNodeNum
(
pModel
)
);
// sans constants
printf
(
"Lev=%5d "
,
Abc_NtkLevel
(
pModel
)
);
printf
(
"Lev=%5d "
,
Abc_NtkLevel
(
pModel
)
);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
...
...
src/base/io/ioReadVerilog.c
View file @
ac7e665b
...
@@ -47,9 +47,9 @@ ABC_NAMESPACE_IMPL_START
...
@@ -47,9 +47,9 @@ ABC_NAMESPACE_IMPL_START
***********************************************************************/
***********************************************************************/
Abc_Ntk_t
*
Io_ReadVerilog
(
char
*
pFileName
,
int
fCheck
)
Abc_Ntk_t
*
Io_ReadVerilog
(
char
*
pFileName
,
int
fCheck
)
{
{
Abc_Ntk_t
*
pNtk
;
Abc_Ntk_t
*
pNtk
,
*
pTemp
;
Abc_Lib_t
*
pDesign
;
Abc_Lib_t
*
pDesign
;
int
RetValue
;
int
i
,
RetValue
;
// parse the verilog file
// parse the verilog file
pDesign
=
Ver_ParseFile
(
pFileName
,
NULL
,
fCheck
,
1
);
pDesign
=
Ver_ParseFile
(
pFileName
,
NULL
,
fCheck
,
1
);
...
@@ -60,8 +60,13 @@ Abc_Ntk_t * Io_ReadVerilog( char * pFileName, int fCheck )
...
@@ -60,8 +60,13 @@ Abc_Ntk_t * Io_ReadVerilog( char * pFileName, int fCheck )
RetValue
=
Abc_LibFindTopLevelModels
(
pDesign
);
RetValue
=
Abc_LibFindTopLevelModels
(
pDesign
);
pNtk
=
(
Abc_Ntk_t
*
)
Vec_PtrEntry
(
pDesign
->
vTops
,
0
);
pNtk
=
(
Abc_Ntk_t
*
)
Vec_PtrEntry
(
pDesign
->
vTops
,
0
);
if
(
RetValue
>
1
)
if
(
RetValue
>
1
)
printf
(
"Warning: The design has %d root-level modules. The first one (%s) will be used.
\n
"
,
{
Vec_PtrSize
(
pDesign
->
vTops
),
pNtk
->
pName
);
printf
(
"Warning: The design has %d root-level modules: "
,
Vec_PtrSize
(
pDesign
->
vTops
)
);
Vec_PtrForEachEntry
(
Abc_Ntk_t
*
,
pDesign
->
vTops
,
pTemp
,
i
)
printf
(
" %s"
,
Abc_NtkName
(
pTemp
)
);
printf
(
"
\n
"
);
printf
(
"The first one (%s) will be used.
\n
"
,
pNtk
->
pName
);
}
// extract the master network
// extract the master network
pNtk
->
pDesign
=
pDesign
;
pNtk
->
pDesign
=
pDesign
;
...
@@ -83,6 +88,7 @@ Abc_Ntk_t * Io_ReadVerilog( char * pFileName, int fCheck )
...
@@ -83,6 +88,7 @@ Abc_Ntk_t * Io_ReadVerilog( char * pFileName, int fCheck )
}
}
//Io_WriteVerilog( pNtk, "_temp.v" );
//Io_WriteVerilog( pNtk, "_temp.v" );
Abc_NtkPrintBoxInfo
(
pNtk
);
return
pNtk
;
return
pNtk
;
}
}
...
...
src/base/ver/verCore.c
View file @
ac7e665b
...
@@ -1098,6 +1098,8 @@ int Ver_ParseAssign( Ver_Man_t * pMan, Abc_Ntk_t * pNtk )
...
@@ -1098,6 +1098,8 @@ int Ver_ParseAssign( Ver_Man_t * pMan, Abc_Ntk_t * pNtk )
pWord
=
Ver_ParseGetName
(
pMan
);
pWord
=
Ver_ParseGetName
(
pMan
);
if
(
pWord
==
NULL
)
if
(
pWord
==
NULL
)
return
0
;
return
0
;
if
(
strcmp
(
pWord
,
"#1"
)
==
0
)
continue
;
// check for vector-inputs
// check for vector-inputs
if
(
!
Ver_ParseLookupSuffix
(
pMan
,
pWord
,
&
nMsb
,
&
nLsb
)
)
if
(
!
Ver_ParseLookupSuffix
(
pMan
,
pWord
,
&
nMsb
,
&
nLsb
)
)
return
0
;
return
0
;
...
...
src/base/ver/verParse.c
View file @
ac7e665b
...
@@ -116,7 +116,7 @@ char * Ver_ParseGetName( Ver_Man_t * pMan )
...
@@ -116,7 +116,7 @@ char * Ver_ParseGetName( Ver_Man_t * pMan )
}
}
else
else
pWord
=
Ver_StreamGetWord
(
p
,
"
\t\n\r
(),;"
);
pWord
=
Ver_StreamGetWord
(
p
,
"
\t\n\r
(),;"
);
if
(
!
Ver_ParseSkipComments
(
pMan
)
)
if
(
Ver_StreamIsOkey
(
p
)
&&
!
Ver_ParseSkipComments
(
pMan
)
)
return
NULL
;
return
NULL
;
return
pWord
;
return
pWord
;
}
}
...
...
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