diff options
Diffstat (limited to 'src/abstract_hardware_model.h')
| -rw-r--r-- | src/abstract_hardware_model.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h index 713c51a..369459b 100644 --- a/src/abstract_hardware_model.h +++ b/src/abstract_hardware_model.h @@ -1315,6 +1315,17 @@ class warp_inst_t : public inst_t { } } } + // MEMCO v3 Model B (unified shared bank-conflict computation). + // Walks the primary's per-lane addresses (if primary is shared) plus each + // valid simd_set whose source is shared/sstarr (using captured + // per_thread_addrs + set_active_mask). Builds a single bank→word→count + // map across the union, computes the max bank-access count, and stores + // it via set_unified_shared_cycles. No subwarp subdivision (assumes a + // unified bank arbiter sees all participating lanes concurrently). + // No-op if env var MEMCOV3_SHARED_UNIFIED is unset, or composite has no + // shared work, or m_per_scalar_thread_valid is false. Records pre/post + // delta in two globals (g_memcov3_shared_unified_*) for diagnostics. + void compute_unified_shared_cycles(); void merge_simd_sets(const std::vector<simd_set_info> &other_sets); void set_source_inst_on_sets(const inst_t *src); void set_split_id_on_sets(unsigned split_id); @@ -1470,6 +1481,27 @@ class warp_inst_t : public inst_t { bool has_dispatch_delay() { return cycles > 0; } + // MEMCO v3 shared unified bank-conflict (Model B). When active, replaces + // per-set max with a single composite-level cycle counter computed across + // all participating lanes' (bank, word) pairs — matching real-HW bank + // arbiter that sees all co-issued lanes concurrently. Activated by + // compute_unified_shared_cycles() at ldst_unit::issue when the env var + // MEMCOV3_SHARED_UNIFIED=1 is set and the composite has shared work. + bool m_unified_shared_active = false; + unsigned m_unified_shared_cycles = 0; + bool dispatch_delay_unified() { + if (m_unified_shared_cycles > 0) m_unified_shared_cycles--; + return m_unified_shared_cycles > 0; + } + bool has_dispatch_delay_unified() const { + return m_unified_shared_cycles > 0; + } + bool unified_shared_active() const { return m_unified_shared_active; } + void set_unified_shared_cycles(unsigned c) { + m_unified_shared_cycles = c; + m_unified_shared_active = true; + } + void print(FILE *fout) const; unsigned get_uid() const { return m_uid; } unsigned long long get_streamID() const { return m_streamID; } |
