Skip to content

rtl: keep buffered KMU launches busy - #387

Open
ForeverHYX wants to merge 1 commit into
vortexgpgpu:masterfrom
ForeverHYX:fix-kmu-buffered-launch-busy
Open

rtl: keep buffered KMU launches busy#387
ForeverHYX wants to merge 1 commit into
vortexgpgpu:masterfrom
ForeverHYX:fix-kmu-buffered-launch-busy

Conversation

@ForeverHYX

Copy link
Copy Markdown

Summary

  • expose in-flight launch state from VX_kmu_arb;
  • include buffered KMU requests in the device busy chain at every hierarchy
    level;
  • add a Verilator regression for a backpressured registered fanout and wire it
    into the unit-test catalog.

Fixes #386

Root cause

VX_kmu clears running when the final CTA is accepted by the next fanout.
When that fanout has OUT_BUF=3, the CTA may still be held in a registered
output before a destination core accepts it. Downstream busy is also registered
through the hierarchy, so producer busy can fall before consumer busy becomes
visible. The resulting false-idle cycle lets a host treat an in-flight launch
as complete.

The fix reports pending while either side of VX_kmu_arb is valid and ORs
that state into the existing Vortex/cluster/socket busy aggregation. The core
graphics launch merge uses the same coverage. This changes only completion
visibility; it does not alter request arbitration, data, ready/valid
backpressure, or execution scheduling.

Regression test

The new hw/unittest/kmu_arb test instantiates a 1-to-2 arbiter with
OUT_BUF=3, transfers one launch into its registered output, then blocks the
selected destination for three cycles. It checks that:

  1. a stalled input asserts pending;
  2. pending remains high when source valid drops and output valid owns the
    request;
  3. backpressure does not pulse or clear pending;
  4. the output handshake cycle remains covered;
  5. pending clears after the fanout drains.

The test is registered as unittest:hw-kmu-arb for both XLEN configurations.

Validation

All commands used an out-of-tree build configured with
--tooldir=$HOME/tools.

  • Sensitivity check with output occupancy intentionally removed:

    buffered handoff: in_valid=0 out_valid=0x1 pending=0
    FAIL: pending must bridge the source-to-buffer ownership transfer
    
  • Restored implementation, XLEN=32 catalog case:

    1 passed, 547 deselected
    
  • Restored implementation, XLEN=64 catalog case:

    1 passed, 483 deselected
    
  • Existing adjacent unit tests:

    make -C hw/unittest/kmu run             # pass
    make -C hw/unittest/cta_dispatcher run  # pass
    
  • Two-core RTL system checks:

    CONFIGS='-DVX_CFG_SOCKET_SIZE=2' ./ci/blackbox.sh \
        --driver=rtlsim --app=basic --cores=2 --args='-n4'
    # Test PASSED; 74 instructions, 540 cycles
    
    ./ci/blackbox.sh --driver=rtlsim --app=demo --cores=2
    # PASSED; 4,888 instructions, 11,525 cycles
    
  • Hardware synthesis smoke:

    make -C hw/syn/yosys
    # Yosys mapping and OpenSTA completed successfully
    
  • git diff --check upstream/master: pass.

The KMU clears running after the final CTA enters a registered fanout. Downstream busy can take another cycle to propagate, so device busy can briefly fall and make the host report completion while the launch remains buffered.

Expose pending from VX_kmu_arb and include it in the busy aggregation at every hierarchy level. Cover the request before and after buffering, and add a Verilator regression that holds a fanout output backpressured across cycles.
Copilot AI lite review requested due to automatic review settings August 8, 2026 10:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Registered KMU fanout can expose a false-idle cycle before the final CTA reaches a core

2 participants