mirror of
https://github.com/zachjs/sv2v.git
synced 2026-09-07 03:43:04 +02:00
consistent size casting behavior
- also adds $clog2 localparam substitution to Simplify
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
module top;
|
||||
|
||||
parameter WIDTH = 32;
|
||||
initial begin
|
||||
logic [31:0] w = 1234;
|
||||
@@ -22,7 +23,14 @@ module top;
|
||||
$display("%0d %0d", y, ($clog2(WIDTH))'(y));
|
||||
$display("%0d %0d", z, ($clog2(WIDTH))'(z));
|
||||
end
|
||||
|
||||
localparam bit foo = '0;
|
||||
localparam logic [31:0] bar = 32'(foo);
|
||||
initial $display("%b %b", foo, bar);
|
||||
|
||||
initial begin
|
||||
$display("%b", 5'('1));
|
||||
$display("%b", 5'(1'sb1));
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module top;
|
||||
|
||||
initial begin : foo_block
|
||||
reg [31:0] w;
|
||||
reg signed [31:0] x;
|
||||
@@ -25,7 +26,14 @@ module top;
|
||||
$display("%0d %0d", y, $signed(y[4:0]));
|
||||
$display("%0d %0d", z, z[4:0]);
|
||||
end
|
||||
|
||||
localparam [0:0] foo = 0;
|
||||
localparam [31:0] bar = 32'b0;
|
||||
initial $display("%b %b", foo, bar);
|
||||
|
||||
initial begin
|
||||
$display("%b", 5'sb11111);
|
||||
$display("%b", 5'sb11111);
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
||||
Reference in New Issue
Block a user