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
82218848
Commit
82218848
authored
Sep 17, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow post inc/dec as first stmt in a block
parent
e2f044ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletions
+16
-1
src/Language/SystemVerilog/Parser/Parse.y
+2
-1
test/basic/inc.sv
+7
-0
test/basic/inc.v
+7
-0
No files found.
src/Language/SystemVerilog/Parser/Parse.y
View file @
82218848
...
@@ -586,6 +586,7 @@ DeclOrStmtTokens(delim) :: { [DeclToken] }
...
@@ -586,6 +586,7 @@ DeclOrStmtTokens(delim) :: { [DeclToken] }
| DeclOrStmtToken DeclOrStmtTokens(delim) { [$1] ++ $2 }
| DeclOrStmtToken DeclOrStmtTokens(delim) { [$1] ++ $2 }
| AsgnOp Expr "," DeclOrStmtTokens(delim) { [DTAsgn $1 $2, DTComma] ++ $4 }
| AsgnOp Expr "," DeclOrStmtTokens(delim) { [DTAsgn $1 $2, DTComma] ++ $4 }
| AsgnOp Expr delim { [DTAsgn $1 $2] }
| AsgnOp Expr delim { [DTAsgn $1 $2] }
| IncOrDecOperator delim { [DTAsgn (AsgnOp $1) (Number "1")] }
| "<=" opt(DelayOrEventControl) Expr "," DeclOrStmtTokens(delim) { [DTAsgnNBlk $2 $3, DTComma] ++ $5 }
| "<=" opt(DelayOrEventControl) Expr "," DeclOrStmtTokens(delim) { [DTAsgnNBlk $2 $3, DTComma] ++ $5 }
| "<=" opt(DelayOrEventControl) Expr delim { [DTAsgnNBlk $2 $3] }
| "<=" opt(DelayOrEventControl) Expr delim { [DTAsgnNBlk $2 $3] }
DeclOrStmtToken :: { DeclToken }
DeclOrStmtToken :: { DeclToken }
...
@@ -882,7 +883,6 @@ Stmt :: { Stmt }
...
@@ -882,7 +883,6 @@ Stmt :: { Stmt }
| Identifier "::" Identifier ";" { Subroutine (Just $1) $3 (Args [] []) }
| Identifier "::" Identifier ";" { Subroutine (Just $1) $3 (Args [] []) }
| LHS "<=" opt(DelayOrEventControl) Expr ";" { Asgn $3 $1 $4 }
| LHS "<=" opt(DelayOrEventControl) Expr ";" { Asgn $3 $1 $4 }
| LHS IncOrDecOperator ";" { AsgnBlk (AsgnOp $2) $1 (Number "1") }
| LHS IncOrDecOperator ";" { AsgnBlk (AsgnOp $2) $1 (Number "1") }
| IncOrDecOperator LHS ";" { AsgnBlk (AsgnOp $1) $2 (Number "1") }
StmtNonAsgn :: { Stmt }
StmtNonAsgn :: { Stmt }
: ";" { Null }
: ";" { Null }
| "begin" opt(Tag) DeclsAndStmts "end" opt(Tag) { Block (combineTags $2 $5) (fst $3) (snd $3) }
| "begin" opt(Tag) DeclsAndStmts "end" opt(Tag) { Block (combineTags $2 $5) (fst $3) (snd $3) }
...
@@ -903,6 +903,7 @@ StmtNonAsgn :: { Stmt }
...
@@ -903,6 +903,7 @@ StmtNonAsgn :: { Stmt }
| "->" Identifier ";" { Trigger $2 }
| "->" Identifier ";" { Trigger $2 }
| AttributeInstance Stmt { StmtAttr $1 $2 }
| AttributeInstance Stmt { StmtAttr $1 $2 }
| ProceduralAssertionStatement { Assertion $1 }
| ProceduralAssertionStatement { Assertion $1 }
| IncOrDecOperator LHS ";" { AsgnBlk (AsgnOp $1) $2 (Number "1") }
Unique :: { Maybe UniquePriority }
Unique :: { Maybe UniquePriority }
: {- empty -} { Nothing }
: {- empty -} { Nothing }
...
...
test/basic/inc.sv
0 → 100644
View file @
82218848
module
top
;
integer
x
=
0
;
initial
begin
x
++;
$
display
(
x
)
;
end
endmodule
test/basic/inc.v
0 → 100644
View file @
82218848
module
top
;
integer
x
=
0
;
initial
begin
x
=
x
+
1
;
$
display
(
x
)
;
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