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
92d827f3
Commit
92d827f3
authored
Nov 20, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preserve else block association, with timings
parent
35a0587d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
src/Language/SystemVerilog/AST/Stmt.hs
+3
-2
test/basic/else_prec.sv
+12
-0
No files found.
src/Language/SystemVerilog/AST/Stmt.hs
View file @
92d827f3
...
@@ -110,11 +110,11 @@ showBranch stmt = '\n' : (indent $ show stmt)
...
@@ -110,11 +110,11 @@ showBranch stmt = '\n' : (indent $ show stmt)
showBlockedBranch
::
Stmt
->
String
showBlockedBranch
::
Stmt
->
String
showBlockedBranch
stmt
=
showBlockedBranch
stmt
=
showBranch
$
showBranch
$
if
isControl
if
isControl
stmt
then
Block
Seq
""
[]
[
stmt
]
then
Block
Seq
""
[]
[
stmt
]
else
stmt
else
stmt
where
where
isControl
=
case
stmt
of
isControl
s
=
case
s
of
If
{}
->
True
If
{}
->
True
For
{}
->
True
For
{}
->
True
While
{}
->
True
While
{}
->
True
...
@@ -122,6 +122,7 @@ showBlockedBranch stmt =
...
@@ -122,6 +122,7 @@ showBlockedBranch stmt =
DoWhile
{}
->
True
DoWhile
{}
->
True
Forever
{}
->
True
Forever
{}
->
True
Foreach
{}
->
True
Foreach
{}
->
True
Timing
_
subStmt
->
isControl
subStmt
_
->
False
_
->
False
showElseBranch
::
Stmt
->
String
showElseBranch
::
Stmt
->
String
...
...
test/basic/else_prec.sv
View file @
92d827f3
...
@@ -29,6 +29,18 @@ module top;
...
@@ -29,6 +29,18 @@ module top;
end
end
end
end
$
display
(
"3 (%b, %b, %b)"
,
a
,
b
,
c
)
;
if
(
a
)
begin
#
1
if
(
b
)
begin
$
display
(
"FOO"
)
;
end
end
else
begin
if
(
c
)
begin
$
display
(
"BAR"
)
;
end
end
end
end
endtask
endtask
...
...
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