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
2d7dc00b
Commit
2d7dc00b
authored
Feb 15, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix concat of based xz literals with uneven chunks
parent
8e1f2bba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
src/Language/SystemVerilog/AST/Number.hs
+3
-2
test/basic/number_concat.sv
+11
-0
test/basic/number_concat.v
+11
-0
No files found.
src/Language/SystemVerilog/AST/Number.hs
View file @
2d7dc00b
...
...
@@ -313,8 +313,9 @@ instance Semigroup Number where
if
kinds1
==
0
&&
kinds2
==
0
then
min
base1
base2
else
Binary
values
=
values2
+
shiftL
values1
size2
kinds
=
kinds2
+
shiftL
kinds1
size2
trim
=
flip
mod
.
(
2
^
)
values
=
trim
size2
values2
+
shiftL
(
trim
size1
values1
)
size2
kinds
=
trim
size2
kinds2
+
shiftL
(
trim
size1
kinds1
)
size2
size1
=
fromIntegral
$
numberBitLength
n1
size2
=
fromIntegral
$
numberBitLength
n2
Based
_
_
base1
values1
kinds1
=
n1
...
...
test/basic/number_concat.sv
View file @
2d7dc00b
...
...
@@ -13,5 +13,16 @@ module top;
`TEST
(
'
sh3
,
'd0
)
;
`TEST
(
'
sh4
,
'd0
)
;
`TEST
(
'b0101
,
'd0
)
;
`TEST
(
17
'
hz
,
1'b0
)
;
`TEST
(
17
'
hzzzzz
,
1'b0
)
;
`TEST
(
17
'
hzzzzz
,
1'bz
)
;
`TEST
(
17
'
hzzzzz
,
1'h0
)
;
`TEST
(
17
'
hzzzzz
,
1'h1
)
;
`TEST
(
17
'
hzzzzz
,
1
'
hx
)
;
`TEST
(
17
'
hzzzzz
,
1
'
hz
)
;
`TEST
(
2
'
hx
,
1'h0
)
;
`TEST
(
2
'
hx
,
1'h1
)
;
`TEST
(
2
'
hx
,
1
'
hx
)
;
`TEST
(
2
'
hx
,
1
'
hz
)
;
end
endmodule
test/basic/number_concat.v
View file @
2d7dc00b
...
...
@@ -13,5 +13,16 @@ module top;
`TEST
(
32
'
sh3
,
32'd0
)
;
`TEST
(
32
'
sh4
,
32'd0
)
;
`TEST
(
32
'
sb0101
,
32'd0
)
;
`TEST
(
17
'
hz
,
1'b0
)
;
`TEST
(
17
'
hzzzzz
,
1'b0
)
;
`TEST
(
17
'
hzzzzz
,
1'bz
)
;
`TEST
(
17
'
hzzzzz
,
1'h0
)
;
`TEST
(
17
'
hzzzzz
,
1'h1
)
;
`TEST
(
17
'
hzzzzz
,
1
'
hx
)
;
`TEST
(
17
'
hzzzzz
,
1
'
hz
)
;
`TEST
(
2
'
hx
,
1'h0
)
;
`TEST
(
2
'
hx
,
1'h1
)
;
`TEST
(
2
'
hx
,
1
'
hx
)
;
`TEST
(
2
'
hx
,
1
'
hz
)
;
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