jump conversion keeps timing controls at the top level

This commit is contained in:
Zachary Snow 2020-02-09 11:53:21 -05:00
parent eb76d16dde
commit 7a00c36a70
3 changed files with 19 additions and 0 deletions

View File

@ -62,6 +62,8 @@ convertModuleItem (AlwaysC kw stmt) = convertMIStmt (AlwaysC kw) stmt
convertModuleItem other = other
convertMIStmt :: (Stmt -> ModuleItem) -> Stmt -> ModuleItem
convertMIStmt constructor (Timing c stmt) =
convertMIStmt (constructor . Timing c) stmt
convertMIStmt constructor stmt =
constructor stmt''
where

View File

@ -106,4 +106,12 @@ module top;
$display("Loop B:", i);
end
always #1
for (int i = 0; i < 10; ++i) begin
$display("Loop C-1:", i);
break;
$display("UNREACHABLE ", `__LINE__);
end
initial #5 $finish;
endmodule

View File

@ -80,4 +80,13 @@ module top;
end
end
always #1 begin : loop_c
integer i;
for (i = 0; i < 10; ++i) begin
$display("Loop C-1:", i);
i = 10;
end
end
initial #5 $finish;
endmodule