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
296e2461
Commit
296e2461
authored
Jul 06, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix multi-dimensional array unbased unsized pattern conversion
parent
95208947
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletions
+21
-1
src/Convert/Struct.hs
+1
-1
test/basic/unbased_unsized.sv
+10
-0
test/basic/unbased_unsized.v
+10
-0
No files found.
src/Convert/Struct.hs
View file @
296e2461
...
...
@@ -192,7 +192,7 @@ convertExpr t (Mux c e1 e2) =
-- populate arrays. Maybe this should be somewhere else?
convertExpr
(
IntegerVector
t
sg
(
r
:
rs
))
(
Pattern
[(
":default"
,
e
)])
=
Repeat
(
rangeSize
r
)
[
e'
]
where
e'
=
convertExpr
(
IntegerVector
t
sg
rs
)
e
where
e'
=
Cast
(
Left
$
IntegerVector
t
sg
rs
)
e
-- TODO: This is a conversion for concat array literals with elements
-- that are unsized numbers. This probably belongs somewhere else.
convertExpr
(
t
@
IntegerVector
{})
(
Pattern
items
)
=
...
...
test/basic/unbased_unsized.sv
View file @
296e2461
...
...
@@ -102,6 +102,16 @@ module top;
`TEST_OP
(
1
,
==,
2'h3
==
'1
,
1'b1
)
end
parameter
A
=
8
;
parameter
B
=
5
;
logic
[
A
-
1
:
0
][
B
-
1
:
0
]
arr
;
initial
begin
arr
=
'
{
default
:
'1
};
$
display
(
"%b"
,
arr
)
;
arr
=
'
{
default
:
'0
};
$
display
(
"%b"
,
arr
)
;
arr
=
'
{
default
:
'x
};
$
display
(
"%b"
,
arr
)
;
arr
=
'
{
default
:
'z
};
$
display
(
"%b"
,
arr
)
;
end
endmodule
module
M
(
a
,
b
,
c
,
d
)
;
...
...
test/basic/unbased_unsized.v
View file @
296e2461
...
...
@@ -97,6 +97,16 @@ module top;
`TEST_OP
(
1
,
==,
2'h3
==
'1
,
1'b1
)
end
parameter
A
=
8
;
parameter
B
=
5
;
reg
[
A
*
B
-
1
:
0
]
arr
;
initial
begin
arr
=
1
'
sb1
;
$
display
(
"%b"
,
arr
)
;
arr
=
1
'
sb0
;
$
display
(
"%b"
,
arr
)
;
arr
=
1
'
sbx
;
$
display
(
"%b"
,
arr
)
;
arr
=
1
'
sbz
;
$
display
(
"%b"
,
arr
)
;
end
endmodule
module
M
(
a
,
b
,
c
,
d
)
;
...
...
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