Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv2v
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
sv2v
Commits
e4efb480
Commit
e4efb480
authored
Mar 27, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix broken for inits parsing; beefed up relong test script to catch such mistakes
parent
ef42fc04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
src/Language/SystemVerilog/Parser/ParseDecl.hs
+11
-5
test/relong/run.sh
+17
-2
No files found.
src/Language/SystemVerilog/Parser/ParseDecl.hs
View file @
e4efb480
...
...
@@ -195,13 +195,16 @@ parseDTsAsDeclOrAsgn tokens =
parseDTsAsDeclsAndAsgns
::
[
DeclToken
]
->
[
Either
Decl
(
LHS
,
Expr
)]
parseDTsAsDeclsAndAsgns
[]
=
[]
parseDTsAsDeclsAndAsgns
tokens
=
if
hasLeadingAsgn
if
hasLeadingAsgn
||
tripLookahead
tokens
then
let
(
lhsToks
,
l0
)
=
break
is
AsgnToke
n
tokens
let
(
lhsToks
,
l0
)
=
break
is
DTAsg
n
tokens
lhs
=
takeLHS
lhsToks
DTAsgnNBlk
Nothing
expr
:
l1
=
l0
DTComma
:
remaining
=
l1
in
Right
(
lhs
,
expr
)
:
parseDTsAsDeclsAndAsgns
remaining
DTAsgn
AsgnOpEq
expr
:
l1
=
l0
asgn
=
Right
(
lhs
,
expr
)
in
case
l1
of
DTComma
:
remaining
->
asgn
:
parseDTsAsDeclsAndAsgns
remaining
[]
->
[
asgn
]
_
->
error
$
"bad decls and asgns tokens: "
++
show
tokens
else
let
(
component
,
remaining
)
=
parseDTsAsComponent
tokens
decls
=
finalize
component
...
...
@@ -213,6 +216,9 @@ parseDTsAsDeclsAndAsgns tokens =
(
Just
a
,
Just
b
)
->
a
>
b
(
Nothing
,
Just
_
)
->
True
_
->
False
isDTAsgn
::
DeclToken
->
Bool
isDTAsgn
(
DTAsgn
_
_
)
=
True
isDTAsgn
_
=
False
isAsgnToken
::
DeclToken
->
Bool
isAsgnToken
(
DTBit
_
)
=
True
...
...
test/relong/run.sh
View file @
e4efb480
#!/bin/sh
SV2V
=
../../bin/sv2v
assertExists
()
{
file
=
$1
[
-f
"
$file
"
]
...
...
@@ -28,6 +30,15 @@ simulate() {
sed
-i
.orig
-e
"1,3d"
"
$sim_outfile
"
}
assertConverts
()
{
ac_file
=
"
$1
"
ac_temp
=
"
$SHUNIT_TMPDIR
/ac-conv-temp.v"
$SV2V
"
$ac_file
"
2> /dev/null
>
"
$ac_temp
"
assertTrue
"1st conversion of
$ac_file
failed"
$?
$SV2V
"
$ac_temp
"
2> /dev/null
>
/dev/null
assertTrue
"2nd conversion of
$ac_file
failed"
$?
}
runTest
()
{
test
=
$1
assertNotNull
"test not specified"
$test
...
...
@@ -38,11 +49,15 @@ runTest() {
assertExists
$sv
assertExists
$ve
assertExists
$sv
assertExists
$tb
assertConverts
"
$sv
"
assertConverts
"
$ve
"
assertConverts
"
$tb
"
# convert the SystemVerilog source file
cv
=
"
$SHUNIT_TMPDIR
/conv-
$test
.v"
../../bin/sv2v
$sv
2> /dev/null
>
$cv
$SV2V
$sv
2> /dev/null
>
$cv
assertTrue
"conversion failed"
$?
assertExists
$cv
...
...
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