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
17e17ebd
Commit
17e17ebd
authored
Jan 20, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix struct array pattern conversion (resolves #60)
parent
cf4c2a54
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
src/Convert/Struct.hs
+9
-0
test/basic/struct_array_inline.sv
+19
-0
test/basic/struct_array_inline.v
+8
-0
No files found.
src/Convert/Struct.hs
View file @
17e17ebd
...
...
@@ -341,6 +341,15 @@ convertAsgn structs types (lhs, expr) =
isStruct
(
Struct
{})
=
True
isStruct
_
=
False
convertExpr
(
Struct
packing
fields
(
r
:
rs
))
(
Pattern
items
)
=
if
all
null
keys
then
convertExpr
(
structTf
(
r
:
rs
))
(
Concat
vals
)
else
Repeat
(
rangeSize
r
)
[
subExpr'
]
where
(
keys
,
vals
)
=
unzip
items
subExpr
=
Pattern
items
structTf
=
Struct
packing
fields
subExpr'
=
convertExpr
(
structTf
rs
)
subExpr
convertExpr
(
Struct
packing
fields
(
r
:
rs
))
subExpr
=
Repeat
(
rangeSize
r
)
[
subExpr'
]
where
...
...
test/basic/struct_array_inline.sv
0 → 100644
View file @
17e17ebd
module
top
;
typedef
struct
packed
{
bit
a
,
b
;
}
T
;
localparam
T
FOO
[
4
]
=
'
{
'
{
0
,
0
},
'
{
0
,
1
},
'
{
1
,
0
},
'
{
1
,
1
}
};
initial
begin
$
display
(
FOO
[
0
]
.
a
)
;
$
display
(
FOO
[
0
]
.
b
)
;
$
display
(
FOO
[
2
]
.
a
)
;
$
display
(
FOO
[
2
]
.
b
)
;
end
endmodule
test/basic/struct_array_inline.v
0 → 100644
View file @
17e17ebd
module
top
;
initial
begin
$
display
(
1'b0
)
;
$
display
(
1'b0
)
;
$
display
(
1'b1
)
;
$
display
(
1'b0
)
;
end
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