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
e7381c4d
Commit
e7381c4d
authored
Mar 24, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix double multipack conversion of Exprs in LHSs
parent
78f3db88
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
7 deletions
+36
-7
src/Convert/MultiplePacked.hs
+12
-7
test/basic/multipack_expr_in_lhs.sv
+12
-0
test/basic/multipack_expr_in_lhs.v
+12
-0
No files found.
src/Convert/MultiplePacked.hs
View file @
e7381c4d
...
...
@@ -115,13 +115,18 @@ traverseExprM = traverseNestedExprsM $ stately traverseExpr
-- LHSs need to be converted too. Rather than duplicating the procedures, we
-- turn LHSs into expressions temporarily and use the expression conversion.
traverseLHSM
::
LHS
->
State
Info
LHS
traverseLHSM
lhs
=
do
let
expr
=
lhsToExpr
lhs
expr'
<-
traverseExprM
expr
case
exprToLHS
expr'
of
Just
lhs'
->
return
lhs'
Nothing
->
error
$
"multi-packed conversion created non-LHS from "
++
(
show
expr
)
++
" to "
++
(
show
expr'
)
traverseLHSM
=
traverseNestedLHSsM
traverseLHSSingleM
where
-- We can't use traverseExprM directly because that would cause Exprs
-- inside of LHSs to be converted twice in a single cycle!
traverseLHSSingleM
::
LHS
->
State
Info
LHS
traverseLHSSingleM
lhs
=
do
let
expr
=
lhsToExpr
lhs
expr'
<-
stately
traverseExpr
expr
case
exprToLHS
expr'
of
Just
lhs'
->
return
lhs'
Nothing
->
error
$
"multi-packed conversion created non-LHS from "
++
(
show
expr
)
++
" to "
++
(
show
expr'
)
traverseExpr
::
Info
->
Expr
->
Expr
traverseExpr
typeMap
=
...
...
test/basic/multipack_expr_in_lhs.sv
0 → 100644
View file @
e7381c4d
module
top
;
logic
[
3
:
0
][
7
:
0
]
arr
;
logic
[
3
:
0
][
1
:
0
]
idx
;
assign
idx
=
{
2'b01
,
2'b11
,
2'b00
,
2'b10
};
initial
begin
arr
[
idx
[
0
]]
=
8'hDE
;
arr
[
idx
[
1
]]
=
8'hAD
;
arr
[
idx
[
2
]]
=
8'hBE
;
arr
[
idx
[
3
]]
=
8'hEF
;
$
display
(
"%h"
,
arr
)
;
end
endmodule
test/basic/multipack_expr_in_lhs.v
0 → 100644
View file @
e7381c4d
module
top
;
reg
[
31
:
0
]
arr
;
wire
[
7
:
0
]
idx
;
assign
idx
=
{
2'b01
,
2'b11
,
2'b00
,
2'b10
};
initial
begin
arr
[
idx
[
0
*
2
+:
2
]
*
8
+:
8
]
=
8'hDE
;
arr
[
idx
[
1
*
2
+:
2
]
*
8
+:
8
]
=
8'hAD
;
arr
[
idx
[
2
*
2
+:
2
]
*
8
+:
8
]
=
8'hBE
;
arr
[
idx
[
3
*
2
+:
2
]
*
8
+:
8
]
=
8'hEF
;
$
display
(
"%h"
,
arr
)
;
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