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
d4c6c0d0
Commit
d4c6c0d0
authored
Feb 17, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support for multiple module instantiations on one line and for module instantiations with no ports
parent
06b47b06
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
Language/SystemVerilog/Parser/Parse.y
+16
-11
No files found.
Language/SystemVerilog/Parser/Parse.y
View file @
d4c6c0d0
...
@@ -225,11 +225,17 @@ ModuleItem :: { [ModuleItem] }
...
@@ -225,11 +225,17 @@ ModuleItem :: { [ModuleItem] }
| IntegerDeclaration { map MIIntegerV $1 }
| IntegerDeclaration { map MIIntegerV $1 }
| "assign" LHS "=" Expr ";" { [Assign $2 $4] }
| "assign" LHS "=" Expr ";" { [Assign $2 $4] }
| "always" opt(EventControl) Stmt { [Always $2 $3] }
| "always" opt(EventControl) Stmt { [Always $2 $3] }
| Identifier ParameterBindings
Identifier Bindings ";" { [Instance $1 $2 $3 $4]
}
| Identifier ParameterBindings
ModuleInstantiations ";" { map (uncurry $ Instance $1 $2) $3
}
| "function" opt(RangeOrType) Identifier FunctionItems Stmt "endfunction" { [Function $2 $3 $4 $5] }
| "function" opt(RangeOrType) Identifier FunctionItems Stmt "endfunction" { [Function $2 $3 $4 $5] }
| "genvar" Identifiers ";" { map Genvar $2 }
| "genvar" Identifiers ";" { map Genvar $2 }
| "generate" GenItems "endgenerate" { [Generate $2] }
| "generate" GenItems "endgenerate" { [Generate $2] }
ModuleInstantiations :: { [(Identifier, [PortBinding])] }
: ModuleInstantiation { [$1] }
| ModuleInstantiations "," ModuleInstantiation { $1 ++ [$3] }
ModuleInstantiation :: { (Identifier, [PortBinding]) }
: Identifier "(" Bindings ")" { ($1, $3) }
FunctionItems :: { [(Bool, BlockItemDeclaration)] }
FunctionItems :: { [(Bool, BlockItemDeclaration)] }
: "(" FunctionPortList ";" BlockItemDeclarations { (map ((,) True) $2) ++ (map ((,) False) $4) }
: "(" FunctionPortList ";" BlockItemDeclarations { (map ((,) True) $2) ++ (map ((,) False) $4) }
| "(" FunctionPortList ";" { (map ((,) True) $2) }
| "(" FunctionPortList ";" { (map ((,) True) $2) }
...
@@ -307,20 +313,19 @@ Sense1 :: { Sense }
...
@@ -307,20 +313,19 @@ Sense1 :: { Sense }
| "negedge" LHS { SenseNegedge $2 }
| "negedge" LHS { SenseNegedge $2 }
Bindings :: { [(Identifier, Maybe Expr)] }
Bindings :: { [(Identifier, Maybe Expr)] }
: "(" Bindings1 ")" { $2 }
: {- empty -} { [] }
| BindingsNonEmpty { $1 }
Bindings1 :: { [(Identifier, Maybe Expr)] }
BindingsNonEmpty :: { [(Identifier, Maybe Expr)] }
: Binding { [$1] }
: Binding { [$1] }
| Bindings1 "," Binding { $1 ++ [$3] }
| Binding "," BindingsNonEmpty { $1 : $3}
Binding :: { (Identifier, Maybe Expr) }
Binding :: { (Identifier, Maybe Expr) }
: "." Identifier "(" MaybeExpr ")" { ($2, $4) }
: "." Identifier "(" MaybeExpr ")" { ($2, $4) }
| "." Identifier { ($2, Just $ Ident $2) }
| "." Identifier { ($2, Just $ Ident $2) }
| Expr { ("", Just $1) }
| Expr { ("", Just $1) }
ParameterBindings :: { [(Identifier, Maybe Expr)] }
ParameterBindings :: { [(Identifier, Maybe Expr)] }
: {- empty -} { [] }
: {- empty -} { [] }
| "#"
Bindings { $2
}
| "#"
"(" BindingsNonEmpty ")" { $3
}
Stmts :: { [Stmt] }
Stmts :: { [Stmt] }
: {- empty -} { [] }
: {- empty -} { [] }
...
...
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