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
64f3067d
Commit
64f3067d
authored
Jun 17, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow dimension shorthand for instance arrays
parent
3cfd368b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
src/Language/SystemVerilog/Parser/ParseDecl.hs
+2
-0
test/basic/instance_array.sv
+5
-5
No files found.
src/Language/SystemVerilog/Parser/ParseDecl.hs
View file @
64f3067d
...
...
@@ -182,6 +182,7 @@ parseDTsAsIntantiations (DTIdent _ name : tokens) =
follow
=
if
null
toks'
then
[]
else
step
(
tail
toks'
)
asRange
::
DeclToken
->
Range
asRange
(
DTRange
_
(
NonIndexed
,
s
))
=
s
asRange
(
DTBit
_
s
)
=
(
Number
"0"
,
BinOp
Sub
s
(
Number
"1"
))
asRange
_
=
failure
failure
=
error
$
"unrecognized instantiation of "
++
name
++
": "
++
show
inst
...
...
@@ -192,6 +193,7 @@ parseDTsAsIntantiations (DTIdent _ name : tokens) =
isInstanceToken
::
DeclToken
->
Bool
isInstanceToken
(
DTInstance
{})
=
True
isInstanceToken
(
DTRange
{})
=
True
isInstanceToken
(
DTBit
{})
=
True
isInstanceToken
(
DTIdent
{})
=
True
isInstanceToken
(
DTComma
{})
=
True
isInstanceToken
_
=
False
...
...
test/basic/instance_array.sv
View file @
64f3067d
...
...
@@ -4,11 +4,11 @@ module Example;
endmodule
module
top
;
Example
e
[
2
:
0
][
4
:
5
]()
;
defparam
e
[
0
][
5
]
.
FOO
=
1
;
defparam
e
[
0
][
4
]
.
FOO
=
2
;
Example
e
[
3
][
4
:
5
]()
;
defparam
e
[
2
][
5
]
.
FOO
=
1
;
defparam
e
[
2
][
4
]
.
FOO
=
2
;
defparam
e
[
1
][
5
]
.
FOO
=
4
;
defparam
e
[
1
][
4
]
.
FOO
=
8
;
defparam
e
[
2
][
5
]
.
FOO
=
16
;
defparam
e
[
2
][
4
]
.
FOO
=
32
;
defparam
e
[
0
][
5
]
.
FOO
=
16
;
defparam
e
[
0
][
4
]
.
FOO
=
32
;
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