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
ac95c5b0
Commit
ac95c5b0
authored
Feb 11, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support for multiple param/localparams in one declaration
parent
39ee2257
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
Language/SystemVerilog/AST.hs
+1
-1
Language/SystemVerilog/Parser/Parse.y
+9
-2
No files found.
Language/SystemVerilog/AST.hs
View file @
ac95c5b0
...
...
@@ -92,7 +92,7 @@ instance Show ModuleItem where
Parameter
r
n
e
->
printf
"parameter %s%s = %s;"
(
showRange
r
)
n
(
showExprConst
e
)
Localparam
r
n
e
->
printf
"localparam %s%s = %s;"
(
showRange
r
)
n
(
showExprConst
e
)
PortDecl
d
r
x
->
printf
"%s %s%s;"
(
show
d
)
(
showRange
r
)
x
LocalNet
t
x
v
->
(
show
t
)
++
" "
++
x
++
assignment
++
";"
LocalNet
t
x
v
->
printf
"%s%s%s;"
(
show
t
)
x
assignment
where
assignment
=
if
v
==
Nothing
...
...
Language/SystemVerilog/Parser/Parse.y
View file @
ac95c5b0
...
...
@@ -211,8 +211,8 @@ MaybeTypeOrRange :: { Either Type (Maybe Range) }
| "wire" MaybeRange { Left $ Wire $2 }
ModuleItem :: { [ModuleItem] }
: "parameter" MaybeRange
Identifier "=" Expr ";" { [Parameter $2 $3 $5]
}
| "localparam" MaybeRange
Identifier "=" Expr ";" { [Localparam $2 $3 $5]
}
: "parameter" MaybeRange
DeclAsgns ";" { map (uncurry $ Parameter $2) $3
}
| "localparam" MaybeRange
DeclAsgns ";" { map (uncurry $ Localparam $2) $3
}
| PortDecl(";") { $1 }
| "reg" MaybeRange WireDeclarations ";" { map (uncurry $ LocalNet $ Reg $2) $3 }
| "wire" MaybeRange WireDeclarations ";" { map (uncurry $ LocalNet $ Wire $2) $3 }
...
...
@@ -225,6 +225,13 @@ ModuleItem :: { [ModuleItem] }
| "always" "@*" Stmt { [Always (Just SenseStar) $3] }
| Identifier ParameterBindings Identifier Bindings ";" { [Instance $1 $2 $3 $4] }
DeclAsgns :: { [(Identifier, Expr)] }
: DeclAsgn { [$1] }
| DeclAsgn "," DeclAsgns { $1 : $3 }
DeclAsgn :: { (Identifier, Expr) }
: Identifier "=" Expr { ($1, $3) }
RegDeclarations :: { [(Identifier, Maybe Range)] }
: Identifier MaybeRange { [($1, $2)] }
| RegDeclarations "," Identifier MaybeRange { $1 ++ [($3, $4)] }
...
...
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