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
64afe6e9
Commit
64afe6e9
authored
Dec 07, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extending Verilog parser to handle 'default' in the case-statement.
parent
e9abb0f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
src/base/wlc/wlcReadVer.c
+21
-5
No files found.
src/base/wlc/wlcReadVer.c
View file @
64afe6e9
...
...
@@ -1033,7 +1033,7 @@ startword:
else
if
(
Wlc_PrsStrCmp
(
pStart
,
"always"
)
)
{
// THIS IS A HACK to detect always statement representing combinational MUX
int
NameId
,
NameIdOut
=
-
1
,
fFound
;
int
NameId
,
NameIdOut
=
-
1
,
fFound
,
nValues
,
fDefaultFound
=
0
;
// find control
pStart
=
Wlc_PrsFindWord
(
pStart
,
"case"
,
&
fFound
);
if
(
pStart
==
NULL
)
...
...
@@ -1054,6 +1054,11 @@ startword:
Vec_IntClear
(
p
->
vFanins
);
Vec_IntPush
(
p
->
vFanins
,
NameId
);
// read data inputs
pObj
=
Wlc_NtkObj
(
p
->
pNtk
,
NameId
);
if
(
pObj
==
NULL
)
return
Wlc_PrsWriteErrorMessage
(
p
,
pStart
,
"Cannot find the object in case statement."
);
// remember the number of values
nValues
=
(
1
<<
Wlc_ObjRange
(
pObj
));
while
(
1
)
{
// find opening
...
...
@@ -1076,6 +1081,17 @@ startword:
pStart
=
Wlc_PrsReadName
(
p
,
pStart
,
p
->
vFanins
);
if
(
pStart
==
NULL
)
return
Wlc_PrsWriteErrorMessage
(
p
,
pStart
,
"Cannot read name inside case statement."
);
// consider default
if
(
fDefaultFound
)
{
int
EntryLast
=
Vec_IntEntryLast
(
p
->
vFanins
);
Vec_IntFillExtra
(
p
->
vFanins
,
nValues
+
1
,
EntryLast
);
// get next line and check its opening character
pStart
=
Wlc_PrsStr
(
p
,
Vec_IntEntry
(
p
->
vStarts
,
++
i
));
pStart
=
Wlc_PrsSkipSpaces
(
pStart
);
}
else
{
// get next line and check its opening character
pStart
=
Wlc_PrsStr
(
p
,
Vec_IntEntry
(
p
->
vStarts
,
++
i
));
pStart
=
Wlc_PrsSkipSpaces
(
pStart
);
...
...
@@ -1083,8 +1099,9 @@ startword:
continue
;
if
(
Wlc_PrsStrCmp
(
pStart
,
"default"
)
)
{
printf
(
"Ignoring default in Line %d.
\n
"
,
i
);
pStart
=
Wlc_PrsStr
(
p
,
Vec_IntEntry
(
p
->
vStarts
,
++
i
));
fDefaultFound
=
1
;
continue
;
}
}
// find closing
pStart
=
Wlc_PrsFindWord
(
pStart
,
"endcase"
,
&
fFound
);
...
...
@@ -1098,8 +1115,7 @@ startword:
break
;
}
// check range of the control
pObj
=
Wlc_NtkObj
(
p
->
pNtk
,
Vec_IntEntry
(
p
->
vFanins
,
0
)
);
if
(
(
1
<<
Wlc_ObjRange
(
pObj
))
!=
Vec_IntSize
(
p
->
vFanins
)
-
1
)
if
(
nValues
!=
Vec_IntSize
(
p
->
vFanins
)
-
1
)
return
Wlc_PrsWriteErrorMessage
(
p
,
pStart
,
"The number of values in the case statement is wrong."
,
pName
);
if
(
Wlc_ObjRange
(
pObj
)
==
1
)
return
Wlc_PrsWriteErrorMessage
(
p
,
pStart
,
"Always-statement with 1-bit control is not bit-blasted correctly."
,
pName
);
...
...
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