mirror of https://github.com/zachjs/sv2v.git
fix size of empty strings to be one byte
This commit is contained in:
parent
a293002ad7
commit
0aa59165a1
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue