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
0aa59165
Commit
0aa59165
authored
May 30, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix size of empty strings to be one byte
parent
a293002a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletions
+9
-1
src/Convert/TypeOf.hs
+1
-1
test/basic/dimensions.sv
+4
-0
test/basic/dimensions.v
+4
-0
No files found.
src/Convert/TypeOf.hs
View file @
0aa59165
...
...
@@ -225,7 +225,7 @@ typeof (String str) =
return
$
IntegerVector
TBit
Unspecified
[
r
]
where
r
=
(
RawNum
$
len
-
1
,
RawNum
0
)
len
=
if
null
str
then
1
else
8
*
unescapedLength
str
len
=
if
null
str
then
8
else
8
*
unescapedLength
str
typeof
other
=
lookupTypeOf
other
-- length of a string literal in characters
...
...
test/basic/dimensions.sv
View file @
0aa59165
...
...
@@ -34,6 +34,10 @@ module top;
$
display
($
size
(
Ram
[
0
]))
;
$
display
($
bits
(
foo
))
;
$
display
(
"bits %0d"
,
$
bits
(
"AB"
))
;
$
display
(
"bits %0d"
,
$
bits
(
"A"
))
;
$
display
(
"bits %0d"
,
$
bits
(
""
))
;
$
display
(
"args %b"
,
$
size
(
RamPair
,
1
))
;
$
display
(
"args %b"
,
$
size
(
RamPair
,
1'b1
))
;
$
display
(
"args %b"
,
$
size
(
RamPair
,
'1
))
;
...
...
test/basic/dimensions.v
View file @
0aa59165
...
...
@@ -31,6 +31,10 @@ module top;
$
display
(
16
)
;
$
display
(
3
)
;
$
display
(
"bits %0d"
,
$
bits
(
"AB"
))
;
$
display
(
"bits %0d"
,
$
bits
(
"A"
))
;
$
display
(
"bits %0d"
,
$
bits
(
""
))
;
$
display
(
"args %b"
,
2
)
;
$
display
(
"args %b"
,
2
)
;
$
display
(
"args %b"
,
2
)
;
...
...
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