Skip to main content
Glama
gokeshenzhen

io.github.gokeshenzhen/traceweave

by gokeshenzhen

inspect_handshake

Classifies clocked valid/ready handshake cycles and reports stalls, backpressure imbalance, payload-hold violations, and premature deassertion to pinpoint protocol failures in simulation waveforms.

Instructions

Classify a clocked valid/ready handshake cycle-by-cycle and report protocol facts that leave no value pattern in scoreboard logs: stalls (valid high, ready low), the longest/over-threshold stall windows, backpressure imbalance (ready high, valid low), and — when payload signals are given — payload-hold violations (a payload that changes while the transfer is still stalled), and premature valid deassertion (a stalled beat whose valid/htrans drops before ready/HREADY arrives — the AHB master-not-waiting-for-HREADY bug, which needs no payload to detect). For AHB (valid_htrans) it ALSO runs x_while_valid (a control field is x/z while valid is asserted) and, when hwrite+write_data are given, a write data-phase HWDATA-hold check (HWDATA must stay stable through a write data-phase wait state). Protocol-agnostic: AXI *valid/*ready, an AHB pair (ready=hready, valid=a 1-bit 'htrans!=IDLE' signal, payload=[haddr,hwrite,hsize] address-phase control which must hold while hready is low; HWDATA goes in write_data, not payload), a generic valid-ready stream, or a credit interface. Returns coverage facts for the checks it actually ran (stall, backpressure, payload-hold, valid-hold, x-while-valid, write-data-hold) without assigning protocol side. Auto-registers a cursor at the first problem (x-while-valid > payload-hold > write-data hold > premature deassertion > long stall > longest stall). On AHB it also returns a protocol_semantics receipt naming which metrics are faithful vs suppressed. For the one-sided violations (x-while-valid, payload-hold, write-data hold, premature deassertion) it also returns a structured attribution block (violating_side=valid_driver, exonerated_side=ready_driver) so the caller does NOT start in the slave driver/monitor — the responder cannot cause either; a plain two-sided stall leaves attribution empty. Reads existing waveforms only — does NOT rerun simulation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
edgeNoClock edge to sample on. Default posedge.posedge
clockYes1-bit clock signal full path.
readyYesReceiver ready/grant signal (1-bit). For AHB, hready.
validNoInitiator valid/request signal (1-bit). Provide this OR valid_htrans.
hwriteNoAHB only: path to HWRITE. With write_data, enables the write data-phase HWDATA-hold check.
payloadNoOptional signals that MUST stay stable while stalled (e.g. AHB htrans/haddr/hwrite/hsize, AXI awaddr/awlen). A mid-stall change is a payload_hold_violation. For AHB do NOT include hwdata here — pass it as write_data (it is a data-phase signal, a different window).
wave_pathYesWaveform (FSDB or VCD).
write_dataNoAHB only: path to HWDATA. With hwrite, checks that write data is held stable through a data-phase wait state (HREADY low) — a write_data_hold_violation otherwise. This is the data-phase window, distinct from the address-phase payload-hold. Pass it ONLY for the producer (initiator/master) interface: on a responder/slave interface HWDATA is an interconnect-mux output that glitches at the clock edge and would false-positive.
active_highNovalid/ready are active-high. Set false for active-low handshakes. Default true.
cursor_nameNoOptional explicit cursor name. Defaults to hs_<sha8>.
cursor_noteNoOptional note attached to the registered cursor.
end_time_psNoWindow end. -1 means end of simulation. Accepts an integer (ps), a cursor reference like '@div_3a7c', or a unit literal like '12.34ns'.
htrans_ruleNoHow valid_htrans derives valid. 'active' (default) = NONSEQ/SEQ (htrans[1]==1); 'non_idle' = htrans != IDLE (counts BUSY too).active
valid_htransNoAHB only: path to the htrans signal. A derived valid is computed from it (AHB has no literal valid). Provide this OR valid, not both.
start_time_psNoWindow start. Default 0. Accepts an integer (ps), a cursor reference like '@div_3a7c', or a unit literal like '12.34ns'.
max_wait_cyclesNoA stall longer than this many cycles becomes a long_stall finding. Default 16.
check_valid_holdNoFlag premature valid/transfer deassertion: a stalled beat (valid high, ready low) whose valid goes low the next edge before ready arrives = the master dropped the transfer instead of waiting (e.g. AHB htrans->IDLE without waiting for HREADY). Needs no payload. Default true.
check_payload_holdNoFlag payload changes during a stall. Default true (only meaningful when payload is given).
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden, and it delivers: it discloses that this tool only reads waveforms and does NOT rerun simulation, that it auto-registers a cursor at the first problem, that one-sided violations are attributed to the valid driver, and that AHB returns a protocol_semantics receipt. This is unusually rich behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but earns most of its length by covering six checks, four protocol shapes, cursor behavior, and attribution semantics. It is front-loaded with the core classification purpose. A few clauses are dense or redundant, such as the HWDATA-hold being explained twice and the awkward phrase 'leave no value pattern in scoreboard logs', which keeps it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Even though there is no output schema, the description tells the agent what to expect from the tool: coverage facts for the checks actually run, a registered cursor at the first problem, a structured attribution block for one-sided violations, and an AHB protocol_semantics receipt. It also distinguishes the empty attribution for plain two-sided stalls. For an 18-parameter, analysis-heavy tool, this is remarkably complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds meaningful semantics beyond the schema: it explains why HWDATA must be passed as write_data rather than payload, which side may safely pass write_data, how valid_htrans derives valid, and what max_wait_cycles defines as a long stall. It does not restate every parameter, but it adds genuine interpretive value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names the exact operation ('Classify a clocked valid/ready handshake cycle-by-cycle') and enumerates concrete outputs such as stall windows, backpressure imbalance, and payload-hold violations. It is clear and specific, but it does not explicitly contrast with nearby siblings like sweep_handshakes or reconstruct_transactions, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives strong protocol context (AXI, AHB, generic, credit) and practical constraints such as 'For AHB do NOT include hwdata here' and 'Pass it ONLY for the producer/initiator interface'. However, it never states when to prefer this tool over a sibling or when not to use it, so the selection guidance is implicit rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gokeshenzhen/TraceWeave'

If you have feedback or need assistance with the MCP directory API, please join our Discord server