Commit 3fde36d9 by Zachary Snow

more portable basic enum test

parent fc3e79dd
......@@ -28,7 +28,7 @@ typedef enum [0:0] {
`define PRINT(name, val) \
dummy``name = name``_``val; \
$display("%010x %010x %02d %02d", \
$display("%h %h %0d %0d", \
name``_``val, dummy``name, $bits(name``_``val), $bits(dummy``name));
module top;
......
`define PRINT(name, val) \
$display("%010x %010x %02d %02d", \
$display("%h %h %0d %0d", \
val, val, $bits(dummy``name), $bits(dummy``name));
module top;
......@@ -9,7 +9,7 @@ module top;
reg [31:0] dummyC;
reg [31:0] dummyD;
reg [31:0] dummyE;
reg dummyF;
reg [0:0] dummyF;
reg [0:0] dummyG;
initial begin
......@@ -45,11 +45,11 @@ module top;
`PRINT(E, 2)
`PRINT(E, 3)
`PRINT(F, 0)
`PRINT(F, 1)
`PRINT(F, 1'b0)
`PRINT(F, 1'b1)
`PRINT(G, 0)
`PRINT(G, 1)
`PRINT(G, 1'b0)
`PRINT(G, 1'b1)
end
endmodule
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment