Skip to content

Commit

Permalink
Do not emit BLKSEQ on suspendable non-sequential process
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Bieganski <[email protected]>
  • Loading branch information
kbieganski committed Jan 8, 2025
1 parent ff244c1 commit 64d0aed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/V3Active.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class ActiveLatchCheckVisitor final : public VNVisitorConst {

class ActiveDlyVisitor final : public VNVisitor {
public:
enum CheckType : uint8_t { CT_SEQ, CT_COMB, CT_INITIAL };
enum CheckType : uint8_t { CT_SEQ, CT_COMB, CT_INITIAL, CT_SUSPENDABLE };

private:
// MEMBERS
Expand All @@ -358,7 +358,7 @@ class ActiveDlyVisitor final : public VNVisitor {
// VISITORS
void visit(AstAssignDly* nodep) override {
// Non-blocking assignments are OK in sequential processes
if (m_check == CT_SEQ) return;
if (m_check == CT_SEQ || m_check == CT_SUSPENDABLE) return;

// Issue appropriate warning
if (m_check == CT_INITIAL) {
Expand Down Expand Up @@ -488,8 +488,9 @@ class ActiveVisitor final : public VNVisitor {

// Warn and convert any delayed assignments
{
ActiveDlyVisitor{nodep, m_clockedProcess ? ActiveDlyVisitor::CT_SEQ
: ActiveDlyVisitor::CT_COMB};
ActiveDlyVisitor{nodep, !m_clockedProcess ? ActiveDlyVisitor::CT_COMB
: oldsensesp ? ActiveDlyVisitor::CT_SEQ
: ActiveDlyVisitor::CT_SUSPENDABLE};
}

// check combinational processes for latches
Expand Down
2 changes: 1 addition & 1 deletion test_regress/t/t_timing_clkgen2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

test.scenarios('simulator')

test.compile(verilator_flags2=["--exe --main --timing"])
test.compile(verilator_flags2=["--exe --main --timing -Wwarn-BLKSEQ"])

test.execute()

Expand Down

0 comments on commit 64d0aed

Please sign in to comment.