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
e9c01d24
Commit
e9c01d24
authored
Dec 03, 2023
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support wait statements
parent
2579bc83
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
0 deletions
+38
-0
CHANGELOG.md
+1
-0
src/Convert/Traverse.hs
+3
-0
src/Language/SystemVerilog/AST/Stmt.hs
+2
-0
src/Language/SystemVerilog/Parser/Parse.y
+1
-0
test/basic/wait.sv
+31
-0
No files found.
CHANGELOG.md
View file @
e9c01d24
...
...
@@ -9,6 +9,7 @@
*
Added support for attributes in unary, binary, and ternary expressions
*
Added support for shadowing interface names with local typenames
*
Added support for passing through
`wait`
statements
### Bug Fixes
...
...
src/Convert/Traverse.hs
View file @
e9c01d24
...
...
@@ -256,6 +256,7 @@ traverseSinglyNestedStmtsM fullMapper = cs
cs
(
Subroutine
expr
exprs
)
=
return
$
Subroutine
expr
exprs
cs
(
Trigger
blocks
x
)
=
return
$
Trigger
blocks
x
cs
stmt
@
Force
{}
=
return
stmt
cs
(
Wait
e
stmt
)
=
fullMapper
stmt
>>=
return
.
Wait
e
cs
(
Assertion
a
)
=
traverseAssertionStmtsM
fullMapper
a
>>=
return
.
Assertion
cs
(
Continue
)
=
return
Continue
...
...
@@ -710,6 +711,8 @@ traverseStmtExprsM exprMapper = flatStmtMapper
l'
<-
lhsMapper
l
e'
<-
exprMapper
e
return
$
Force
kw
l'
e'
flatStmtMapper
(
Wait
e
stmt
)
=
exprMapper
e
>>=
\
e'
->
return
$
Wait
e'
stmt
flatStmtMapper
(
Assertion
a
)
=
traverseAssertionExprsM
exprMapper
a
>>=
return
.
Assertion
flatStmtMapper
(
Continue
)
=
return
Continue
...
...
src/Language/SystemVerilog/AST/Stmt.hs
View file @
e9c01d24
...
...
@@ -53,6 +53,7 @@ data Stmt
|
Trigger
Bool
Identifier
|
Assertion
Assertion
|
Force
Bool
LHS
Expr
|
Wait
Expr
Stmt
|
Continue
|
Break
|
Null
...
...
@@ -106,6 +107,7 @@ instance Show Stmt where
(
True
,
False
)
->
"release"
(
False
,
True
)
->
"assign"
(
False
,
False
)
->
"deassign"
show
(
Wait
e
s
)
=
printf
"wait (%s)%s"
(
show
e
)
(
showShortBranch
s
)
show
(
Continue
)
=
"continue;"
show
(
Break
)
=
"break;"
show
(
Null
)
=
";"
...
...
src/Language/SystemVerilog/Parser/Parse.y
View file @
e9c01d24
...
...
@@ -1149,6 +1149,7 @@ StmtNonBlock :: { Stmt }
|
"deassign"
LHS
";"
{
Force
False
$
2
Nil
}
|
"force"
LHS
"="
Expr
";"
{
Force
True
$
2
$
4
}
|
"release"
LHS
";"
{
Force
True
$
2
Nil
}
|
"wait"
"("
Expr
")"
Stmt
{
Wait
$
3
$
5
}
OptDelayOrEvent
::
{
Maybe
Timing
}
:
DelayOrEvent
{
Just
$
1
}
...
...
test/basic/wait.sv
0 → 100644
View file @
e9c01d24
module
top
;
reg
a
,
b
,
c
,
d
;
initial
begin
fork
#
1
a
=
1
;
wait
(
a
)
;
join
$
display
(
"a %0d"
,
$
time
)
;
end
initial
begin
fork
b
=
1
;
#
1
wait
(
b
)
;
join
$
display
(
"b %0d"
,
$
time
)
;
end
initial
begin
fork
#
1
wait
(
c
)
$
display
(
"c done %0d"
,
$
time
)
;
#
1
wait
(
d
)
$
display
(
"d done %0d"
,
$
time
)
;
begin
#
1
c
=
1
;
#
1
d
=
1
;
end
join
$
display
(
"cd %0d"
,
$
time
)
;
end
endmodule
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