3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-18 01:02:19 +00:00

sv: fix up end label checking

- disallow [gen]blocks with an end label but not begin label
- check validity of module end label
- fix memory leak of package name and end label
- fix memory leak of module end label
This commit is contained in:
Zachary Snow 2021-06-14 15:32:01 -04:00 committed by Zachary Snow
parent 092f0cb01e
commit f2c2d73f36
7 changed files with 98 additions and 7 deletions

View file

@ -0,0 +1,29 @@
module top(
output reg [7:0]
out1, out2, out3, out4
);
initial begin
begin : blk1
reg x;
x = 1;
end
out1 = blk1.x;
begin : blk2
reg x;
x = 2;
end : blk2
out2 = blk2.x;
end
if (1) begin
if (1) begin : blk3
reg x;
assign x = 3;
end
assign out3 = blk3.x;
if (1) begin : blk4
reg x;
assign x = 4;
end : blk4
assign out4 = blk4.x;
end
endmodule