2019-09-12 04:52:01 +02:00
|
|
|
module top;
|
|
|
|
|
localparam BW = 3;
|
|
|
|
|
logic [2:0] test;
|
2020-02-15 22:40:50 +01:00
|
|
|
logic [3:0] foo;
|
|
|
|
|
logic [3:0] bar;
|
2021-02-03 22:12:05 +01:00
|
|
|
integer x;
|
|
|
|
|
reg [7:0] y;
|
2020-02-15 22:40:50 +01:00
|
|
|
|
|
|
|
|
initial begin
|
|
|
|
|
test = BW'(0);
|
|
|
|
|
$display(test);
|
|
|
|
|
foo = 2'('1);
|
|
|
|
|
$display(foo);
|
|
|
|
|
bar = $bits(bar)'('1);
|
|
|
|
|
$display(bar);
|
2021-02-03 22:12:05 +01:00
|
|
|
x = 1'('1); $display("%b %0d", x, x);
|
|
|
|
|
y = 1'('1); $display("%b %0d", y, y);
|
|
|
|
|
x = 2'('0); $display("%b %0d", x, x);
|
|
|
|
|
y = 2'('0); $display("%b %0d", y, y);
|
|
|
|
|
x = 2'('1); $display("%b %0d", x, x);
|
|
|
|
|
y = 2'('1); $display("%b %0d", y, y);
|
|
|
|
|
x = 2'('x); $display("%b %0d", x, x);
|
|
|
|
|
y = 2'('x); $display("%b %0d", y, y);
|
|
|
|
|
x = 2'('z); $display("%b %0d", x, x);
|
|
|
|
|
y = 2'('z); $display("%b %0d", y, y);
|
2020-02-15 22:40:50 +01:00
|
|
|
end
|
2019-09-12 04:52:01 +02:00
|
|
|
endmodule
|