mirror of https://github.com/zachjs/sv2v.git
preserve else block association, with timings
This commit is contained in:
parent
35a0587d2c
commit
92d827f3a5
|
|
@ -110,11 +110,11 @@ showBranch stmt = '\n' : (indent $ show stmt)
|
|||
showBlockedBranch :: Stmt -> String
|
||||
showBlockedBranch stmt =
|
||||
showBranch $
|
||||
if isControl
|
||||
if isControl stmt
|
||||
then Block Seq "" [] [stmt]
|
||||
else stmt
|
||||
where
|
||||
isControl = case stmt of
|
||||
isControl s = case s of
|
||||
If{} -> True
|
||||
For{} -> True
|
||||
While{} -> True
|
||||
|
|
@ -122,6 +122,7 @@ showBlockedBranch stmt =
|
|||
DoWhile{} -> True
|
||||
Forever{} -> True
|
||||
Foreach{} -> True
|
||||
Timing _ subStmt -> isControl subStmt
|
||||
_ -> False
|
||||
|
||||
showElseBranch :: Stmt -> String
|
||||
|
|
|
|||
|
|
@ -29,6 +29,18 @@ module top;
|
|||
end
|
||||
end
|
||||
|
||||
$display("3 (%b, %b, %b)", a, b, c);
|
||||
if (a) begin
|
||||
#1
|
||||
if (b) begin
|
||||
$display("FOO");
|
||||
end
|
||||
end else begin
|
||||
if (c) begin
|
||||
$display("BAR");
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
endtask
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue