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
801955ff
Commit
801955ff
authored
May 21, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support for empty port connections
parent
eae46b7a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
5 deletions
+45
-5
src/Language/SystemVerilog/Parser/Parse.y
+13
-5
test/basic/unbound_port.sv
+29
-0
test/basic/unbound_port.v
+2
-0
test/lib/functions.sh
+1
-0
No files found.
src/Language/SystemVerilog/Parser/Parse.y
View file @
801955ff
...
@@ -965,11 +965,14 @@ LHSs :: { [LHS] }
...
@@ -965,11 +965,14 @@ LHSs :: { [LHS] }
|
LHSs
","
LHS
{
$
1
++
[
$
3
]
}
|
LHSs
","
LHS
{
$
1
++
[
$
3
]
}
PortBindings
::
{
[
PortBinding
]
}
PortBindings
::
{
[
PortBinding
]
}
:
"("
")"
{
[]
}
:
"("
PortBindingsInside
")"
{
%
checkPortBindings
$
2
}
|
"("
PortBindingsInside
")"
{
%
checkPortBindings
$
2
}
PortBindingsInside
::
{
[
PortBinding
]
}
PortBindingsInside
::
{
[
PortBinding
]
}
:
PortBinding
opt
(
","
)
{
[
$
1
]
}
:
OptPortBinding
{
[
$
1
]
}
|
PortBinding
","
PortBindingsInside
{
$
1
:
$
3
}
|
OptPortBinding
","
PortBindingsInside
{
$
1
:
$
3
}
OptPortBinding
::
{
PortBinding
}
:
{- empty -}
{
(
""
,
Nil
)
}
|
PortBinding
{
$
1
}
PortBinding
::
{
PortBinding
}
PortBinding
::
{
PortBinding
}
:
"."
Identifier
"("
ExprOrNil
")"
{
(
$
2
,
$
4
)
}
:
"."
Identifier
"("
ExprOrNil
")"
{
(
$
2
,
$
4
)
}
|
"."
Identifier
{
(
$
2
,
Ident
$
2
)
}
|
"."
Identifier
{
(
$
2
,
Ident
$
2
)
}
...
@@ -1507,7 +1510,12 @@ missingToken expected = do
...
@@ -1507,7 +1510,12 @@ missingToken expected = do
throwError
$
show
p
++
": Parse error: missing expected `"
++
expected
++
"`"
throwError
$
show
p
++
": Parse error: missing expected `"
++
expected
++
"`"
checkPortBindings
::
[
PortBinding
]
->
ParseState
[
PortBinding
]
checkPortBindings
::
[
PortBinding
]
->
ParseState
[
PortBinding
]
checkPortBindings
=
checkBindings
"port connections"
checkPortBindings
[]
=
return
[]
checkPortBindings
bindings
=
checkBindings
"port connections"
$
if
last
bindings
==
(
""
,
Nil
)
then
init
bindings
else
bindings
checkParamBindings
::
[
ParamBinding
]
->
ParseState
[
ParamBinding
]
checkParamBindings
::
[
ParamBinding
]
->
ParseState
[
ParamBinding
]
checkParamBindings
=
checkBindings
"parameter overrides"
checkParamBindings
=
checkBindings
"parameter overrides"
...
...
test/basic/unbound_port.sv
0 → 100644
View file @
801955ff
`ifndef
TRAIL
`define
TRAIL
,
`endif
module
mod
#(
parameter
[
23
:
0
]
KEY
=
"INV"
)
(
a
,
b
,
c
)
;
input
wire
[
31
:
0
]
a
,
b
,
c
;
initial
#
1
$
display
(
"%s a=%0d b=%0d c=%0d"
,
KEY
,
a
,
b
,
c
)
;
endmodule
module
top
;
mod
#(
"MA0"
)
MA0
(
,
,
)
;
mod
#(
"MA1"
)
MA1
(
1
,
,
)
;
mod
#(
"MA2"
)
MA2
(
1
,
2
,
)
;
mod
#(
"MA3"
)
MA3
(
1
,
2
,
3
)
;
mod
#(
"MA4"
)
MA4
(
1
,
,
3
)
;
mod
#(
"MA5"
)
MA5
(
1
,
,
3
)
;
mod
#(
"MA6"
)
MA6
(
,
2
,
3
)
;
mod
#(
"MA7"
)
MA7
(
,
,
3
)
;
mod
#(
"MB0"
)
MB0
(
,
,
`TRAIL
)
;
mod
#(
"MB1"
)
MB1
(
1
,
,
`TRAIL
)
;
mod
#(
"MB2"
)
MB2
(
1
,
2
,
`TRAIL
)
;
mod
#(
"MB3"
)
MB3
(
1
,
2
,
3
`TRAIL
)
;
mod
#(
"MB4"
)
MB4
(
1
,
,
3
`TRAIL
)
;
mod
#(
"MB5"
)
MB5
(
1
,
,
3
`TRAIL
)
;
mod
#(
"MB6"
)
MB6
(
,
2
,
3
`TRAIL
)
;
mod
#(
"MB7"
)
MB7
(
,
,
3
`TRAIL
)
;
endmodule
test/basic/unbound_port.v
0 → 100644
View file @
801955ff
`define
TRAIL
`include
"unbound_port.sv"
test/lib/functions.sh
View file @
801955ff
...
@@ -22,6 +22,7 @@ simulate() {
...
@@ -22,6 +22,7 @@ simulate() {
-Wall
\
-Wall
\
-Wno-select-range
\
-Wno-select-range
\
-Wno-anachronisms
\
-Wno-anachronisms
\
-Wno-portbind
\
-o
$sim_prog
\
-o
$sim_prog
\
-g2005
\
-g2005
\
-DTEST_VCD
=
"
\"
$sim_vcd
\"
"
\
-DTEST_VCD
=
"
\"
$sim_vcd
\"
"
\
...
...
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