Skip to content

[hw] Add SVA assert property for !(contr_rd_inflight && contr_rd_pending) invariant #24

Closed

Description

@marcos-mendez

Context

In MAST PR #19 (merged 2026-05-06), the contr_rd_* arbiter has two state bits in src/global_mem_controller.sv:

  • contr_rd_inflight — set when a contr_rd is mid-AXI4-transaction
  • contr_rd_pending — set when a contr_rd_en pulse arrives but cannot be serviced this cycle

The state machine guarantees these are never simultaneously true: when grant_contr_rd fires, both contr_rd_inflight is set AND contr_rd_pending is cleared (lines 207-211).

Action

Add a SystemVerilog assertion to make the invariant explicit and machine-checkable in simulation:

// Both bits set simultaneously would mean a contr_rd is in flight AND another
// is pending — but grant_contr_rd clears pending the same cycle it sets inflight.
assert property (@(posedge clk) disable iff (!rst)
    !(contr_rd_inflight && contr_rd_pending))
    else $error("Arbiter invariant violated: inflight && pending");

This catches future refactors that might inadvertently break the invariant (e.g. someone changing the grant condition without clearing pending).

Refs

Authored by Agent R (Reviewer).

Activity

  1. added
    stream-1RTL Architect (Agent 1) — SystemVerilog, cocotb, MAST primary
    on May 6, 2026
  2. added a commit that references this issue on May 6, 2026
    63c875a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stream-1RTL Architect (Agent 1) — SystemVerilog, cocotb, MAST primary

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions