Latency model: HBM PC striping + chunk-loop drain (ADR-0033)
Previous model double-counted slow-upstream paths (e.g., 64KB via UCIe 128 GB/s was ~2x pessimistic). HBM CTRL now distributes bursts across 8 pseudo-channels via global round-robin, with per-chunk commit timing that pipelines correctly against the bottleneck link's data arrival. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Iterator
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any
|
||||
|
||||
@@ -47,3 +48,46 @@ class Transaction:
|
||||
is_response=self.is_response,
|
||||
result_data=self.result_data,
|
||||
)
|
||||
|
||||
def into_flits(self, flit_bytes: int) -> Iterator[Flit]:
|
||||
"""Decompose this Transaction's payload into Flits (ADR-0033 D1).
|
||||
|
||||
Yields one Flit per ``flit_bytes`` of payload. The final flit may
|
||||
carry fewer bytes when ``nbytes`` is not a multiple of ``flit_bytes``;
|
||||
that flit has ``is_last=True``. Transactions with ``nbytes <= 0``
|
||||
yield no flits.
|
||||
|
||||
All yielded Flits share a reference to this Transaction.
|
||||
"""
|
||||
if self.nbytes <= 0 or flit_bytes <= 0:
|
||||
return
|
||||
n_full = self.nbytes // flit_bytes
|
||||
remainder = self.nbytes % flit_bytes
|
||||
n_total = n_full + (1 if remainder else 0)
|
||||
for i in range(n_total):
|
||||
size = flit_bytes if i < n_full else remainder
|
||||
yield Flit(
|
||||
txn=self,
|
||||
flit_index=i,
|
||||
flit_nbytes=size,
|
||||
is_last=(i == n_total - 1),
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
class Flit:
|
||||
"""Atomic wire transport unit (ADR-0033 D1).
|
||||
|
||||
Carries a slice of a parent Transaction's payload. The wire
|
||||
(``engine._wire``) decomposes Transactions into Flits on first
|
||||
transport; downstream wires pass Flits through with their own
|
||||
``bw_gbs`` delay.
|
||||
|
||||
Phase 2 constraint: ``flit_bytes`` MUST be a multiple of HBM
|
||||
``burst_bytes`` (default they are equal). See ADR-0033 D1.
|
||||
"""
|
||||
|
||||
txn: Transaction # parent transaction reference
|
||||
flit_index: int # 0..n_flits-1
|
||||
flit_nbytes: int # bytes carried (usually flit_bytes; last may be smaller)
|
||||
is_last: bool # True for the terminating flit
|
||||
|
||||
Reference in New Issue
Block a user