Skip to content

Commit

Permalink
fix assertion removal in verbose mode causing orphaned statements
Browse files Browse the repository at this point in the history
  • Loading branch information
zachjs committed Sep 24, 2021
1 parent 540a0c8 commit 814f965
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
unpacked arrays, or in designs with multi-dimensional instances
* Fixed conversion of module-scoped references to modports
* Fixed conversion of references to modports nested within types in expressions
* Fixed assertion removal in verbose mode causing orphaned statements

## v0.0.8

Expand Down
2 changes: 2 additions & 0 deletions src/Convert/Traverse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ traverseSinglyNestedStmtsM fullMapper = cs
where
cs (StmtAttr a stmt) = fullMapper stmt >>= return . StmtAttr a
cs (Block _ "" [] []) = return Null
cs (Block _ "" [] [CommentStmt{}]) = return Null
cs (Block _ "" [] [stmt]) = fullMapper stmt
cs (Block _ "" [CommentDecl{}] []) = return Null
cs (Block Seq name decls stmts) = do
stmts' <- mapM fullMapper stmts
return $ Block Seq name decls $ concatMap explode stmts'
Expand Down
14 changes: 14 additions & 0 deletions test/core/assert.sv
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,18 @@ module Module(input clock, input clear, input data);
assert property (x == y);
named_stmt: assert property (x == y);
end
always @(posedge x) begin
assert (1);
end
always @(posedge x)
case (x)
0: begin
assert (1);
end
1:
assert (1);
default: begin
assert (1);
end
endcase
endmodule

0 comments on commit 814f965

Please sign in to comment.