logic conversion supports generate block scoping

This commit is contained in:
Zachary Snow
2020-07-02 22:59:06 -06:00
parent af319c3655
commit cd8af036a0
3 changed files with 137 additions and 86 deletions
+27
View File
@@ -13,4 +13,31 @@ module top;
$display("%b %b %b %b", x, y, z, f());
$display("%b %b %b %b", x, y, z, f());
end
generate
begin : A
logic x;
begin : B
logic x;
end
begin : C
logic x;
end
assign x = B.x ^ C.x;
end
endgenerate
initial A.B.x = 0;
assign A.C.x = 1;
initial $display("%b %b %b %b", x, A.x, A.B.x, A.C.x);
logic t2l;
task t2;
input logic t2l;
top.t2l = t2l;
endtask
initial begin
$display("%b", t2l);
t2(1);
$display("%b", t2l);
end
endmodule
+27
View File
@@ -17,4 +17,31 @@ module top;
$display("%b %b %b %b", x, y, z, f(0));
$display("%b %b %b %b", x, y, z, f(0));
end
generate
begin : A
wire x;
begin : B
reg x;
end
begin : C
wire x;
end
assign x = B.x ^ C.x;
end
endgenerate
initial A.B.x = 0;
assign A.C.x = 1;
initial $display("%b %b %b %b", x, A.x, A.B.x, A.C.x);
reg t2l;
task t2;
input reg t2l;
top.t2l = t2l;
endtask
initial begin
$display("%b", t2l);
t2(1);
$display("%b", t2l);
end
endmodule