support complex sizes in size casts (resolves #69)

This commit is contained in:
Zachary Snow
2020-02-15 16:48:09 -05:00
parent fe8839eaec
commit 463cdcb2c1
3 changed files with 26 additions and 11 deletions
+11 -2
View File
@@ -1,6 +1,15 @@
module top;
localparam BW = 3;
logic [2:0] test;
assign test = BW'(0);
initial #1 $display(test);
logic [3:0] foo;
logic [3:0] bar;
initial begin
test = BW'(0);
$display(test);
foo = 2'('1);
$display(foo);
bar = $bits(bar)'('1);
$display(bar);
end
endmodule
+12 -4
View File
@@ -1,6 +1,14 @@
module top;
localparam BW = 3;
wire [2:0] test;
assign test = 0;
initial #1 $display(test);
reg [2:0] test;
reg [3:0] foo;
reg [3:0] bar;
initial begin
test = 0;
$display(test);
foo = 4'b0011;
$display(foo);
bar = 4'b1111;
$display(bar);
end
endmodule