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
512d4b1a
Commit
512d4b1a
authored
Sep 17, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support module "list of param assignments" shorthand
parent
bdafb60d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
src/Language/SystemVerilog/Parser/Parse.y
+8
-2
test/basic/param_shorthand.sv
+9
-0
test/basic/param_shorthand.v
+9
-0
No files found.
src/Language/SystemVerilog/Parser/Parse.y
View file @
512d4b1a
...
@@ -528,8 +528,14 @@ Params :: { [ModuleItem] }
...
@@ -528,8 +528,14 @@ Params :: { [ModuleItem] }
: {- empty -} { [] }
: {- empty -} { [] }
| "#" "(" ParamsFollow { map (MIPackageItem . Decl) $3 }
| "#" "(" ParamsFollow { map (MIPackageItem . Decl) $3 }
ParamsFollow :: { [Decl] }
ParamsFollow :: { [Decl] }
: ParameterDecl(")") { $1 }
: ParamAsgn ")" { [$1] }
| ParameterDecl(",") ParamsFollow { $1 ++ $2 }
| ParamAsgn "," ParamsFollow { $1 : $3 }
| ParamsDecl { $1 }
ParamsDecl :: { [Decl] }
: ParameterDecl(")") { $1 }
| ParameterDecl(",") ParamsDecl { $1 ++ $2 }
ParamAsgn :: { Decl }
: Identifier "=" Expr { Param Parameter (Implicit Unspecified []) $1 $3 }
PortDecls :: { ([Identifier], [ModuleItem]) }
PortDecls :: { ([Identifier], [ModuleItem]) }
: "(" DeclTokens(")") { parseDTsAsPortDecls $2 }
: "(" DeclTokens(")") { parseDTsAsPortDecls $2 }
...
...
test/basic/param_shorthand.sv
0 → 100644
View file @
512d4b1a
module
top
#(
FOO
=
10
)
;
initial
$
display
(
FOO
)
;
endmodule
module
top2
#(
FOO
=
10
,
BAR
=
11
)
;
initial
$
display
(
FOO
,
BAR
)
;
endmodule
module
top3
#(
FOO
=
10
,
BAR
=
11
,
parameter
BAZ
=
12
)
;
initial
$
display
(
FOO
,
BAR
,
BAZ
)
;
endmodule
test/basic/param_shorthand.v
0 → 100644
View file @
512d4b1a
module
top
#(
parameter
FOO
=
10
)
;
initial
$
display
(
FOO
)
;
endmodule
module
top2
#(
parameter
FOO
=
10
,
parameter
BAR
=
11
)
;
initial
$
display
(
FOO
,
BAR
)
;
endmodule
module
top3
#(
parameter
FOO
=
10
,
parameter
BAR
=
11
,
parameter
BAZ
=
12
)
;
initial
$
display
(
FOO
,
BAR
,
BAZ
)
;
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