Avoid eager StopIteration on matching transcript and suppress ACR disk write in PMU setup

- Guard mismatch lookup in check_gpu_pmu_ls_start_binary.py behind
  'if registers != expected:' so matching transcripts do not raise StopIteration
  inside eager require() argument evaluation.
- Truncate the ACR prefix executed by pmu_original_environment.py before its
  target/gpu-stage mkdir/write_bytes block (and set _PMU_ORIGINAL_ENV = True)
  so PMU --check runs never create or overwrite original-acr-hs-image-gv100.bin.
This commit is contained in:
morebrackets
2026-12-02 16:25:04 -08:00
parent 14c4c6e9bd
commit 7b68919e72
2 changed files with 13 additions and 3 deletions

View File

@ -148,8 +148,13 @@ require(status == 0)
registers = [token for token in events if token[:2] in ("r:", "w:")]
expected = [token for line, token in transcript_numbered(FIRST, LAST)
if not CLOCK_LINES[0] <= line <= CLOCK_LINES[1]]
require(registers == expected, next(
(index, a, e) for index, (a, e) in enumerate(zip(registers + [None], expected)) if a != e))
if registers != expected:
mismatch = next(
(index, a, e)
for index, (a, e) in enumerate(zip(registers + [None], expected + [None]))
if a != e
)
require(False, mismatch)
ARGUMENTS_TRACED = bytes(cpu.mem_read(PMU + 0xd30, 0x30))
require(ARGUMENTS_TRACED.hex() == (
"00bf2f20" + "00" * 24 + "00000004" + "00000000" + "007a2020" + "00000000" + "00000000"))

View File

@ -19,8 +19,13 @@ _ACR = Path(__file__).resolve().with_name("check_gpu_acr_load_binary.py")
_source = _ACR.read_text()
_marker = 'if "--traced" in sys.argv:'
require(_marker in _source)
_prefix = _source[:_source.index(_marker)]
_write_marker = '(ROOT / "target/gpu-stage").mkdir('
if _write_marker in _prefix:
_prefix = _prefix[:_prefix.index(_write_marker)]
_PMU_ORIGINAL_ENV = True
_saved_file, __file__ = __file__, str(_ACR)
exec(compile(_source[:_source.index(_marker)], str(_ACR), "exec"), globals()) # noqa: S102
exec(compile(_prefix, str(_ACR), "exec"), globals()) # noqa: S102
__file__ = _saved_file
calls, asserts, diag = [], [], []