From 314fb652d8a27a38599eeeec121d45327a405bb0 Mon Sep 17 00:00:00 2001 From: Davit Grigoryan Date: Wed, 29 Apr 2026 00:02:46 +0000 Subject: impl option w/ only 2 SBs; stall so SBs are cleared before div or reconv --- src/gpgpu-sim/scoreboard.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/gpgpu-sim/scoreboard.h') diff --git a/src/gpgpu-sim/scoreboard.h b/src/gpgpu-sim/scoreboard.h index 660587e..da34af5 100644 --- a/src/gpgpu-sim/scoreboard.h +++ b/src/gpgpu-sim/scoreboard.h @@ -32,6 +32,7 @@ #include #include #include +#include #include "assert.h" #ifndef SCOREBOARD_H_ @@ -83,8 +84,29 @@ class Scoreboard { // Per-set release dispatcher used at writeback. In mode 0, picks // primary vs secondary release based on `is_intra_legacy`. In mode 1, // releases (reg, mask) from mask_reg_table; `is_intra_legacy` ignored. + // In mode 2, releases (reg) from slot_reg_table[wid][slot_id]. void releaseSetReg(unsigned wid, unsigned reg, const active_mask_t &mask, - bool is_intra_legacy); + bool is_intra_legacy, unsigned slot_id = 0); + + // Mode 2: slot-pinned per-half scoreboards. Each warp has two + // independent scoreboards (one per ibuffer half). Hazard tracking + // ignores masks since slot ownership guarantees lane-disjoint + // operation between the two halves. See + // for_claude/docs/scoreboard_redesign_plan.md. + static const unsigned NUM_SLOTS = 2; + void reserveRegisterSlot(unsigned wid, unsigned slot, unsigned regnum); + void releaseRegisterSlot(unsigned wid, unsigned slot, unsigned regnum); + bool checkCollisionSlot(unsigned wid, unsigned slot, + const inst_t *inst) const; + bool pendingWritesSlot(unsigned wid, unsigned slot) const { + return !slot_reg_table[wid][slot].empty(); + } + bool slotClean(unsigned wid, unsigned slot) const { + return slot_reg_table[wid][slot].empty(); + } + bool bothSlotsClean(unsigned wid) const { + return slot_reg_table[wid][0].empty() && slot_reg_table[wid][1].empty(); + } public: // Accounting / leak-detection (called from gpu-sim end-of-run dump). @@ -113,6 +135,10 @@ class Scoreboard { // Secondary path register tracking (for I-Buffer half 1, intra-warp co-issue) std::vector > sec_reg_table; + // Mode 2: per-warp, per-slot register sets. + // slot_reg_table[wid][slot] = set of reserved register numbers. + std::vector, NUM_SLOTS> > slot_reg_table; + // Mode 1: per-warp list of mask-aware reservations. struct mask_resv { unsigned reg; -- cgit v1.3