Files
vt1200/harness/mame/wall_hist.lua
T
arti 41454d5d4c harness: the stub level-1 run continues past both DUART failures; correct the "fatal/LED loop" claim
The stub run does not park at HOST PORT - 15. Both DUART failures are reported,
the board LED blinks once (finite L3F208660), TYPE 'GO' TO CONTINUE is printed
(no input is read), and the level-1 runner continues ('CONTINUING THE TESTS').
The runner never returns to 3F204440, so 3F208060/3F208650 are never executed.

The run then wedges at frame ~2839 in a DUART1 counter-ready interrupt storm:
the ISR polls DUART1 reg 5 (bit 0x06400050) and always reads 0x08; the counter
runs in timer mode (ACR=0x60) with CTUR/CTLR never programmed, so MAME re-arms
at 1 tick and the interrupt re-asserts every ~229 CPU cycles. Frames at 3500 /
6000 / 12000 are byte-identical; RAM differs by one byte.

Corrects README.md and annotates GATE_CLEANUP_REPORT.md, BRINGUP_LOG.md and
DUART_REPORT.md. Adds a console+PC/milestone instrument and the finding report.
2026-10-16 14:56:47 +03:00

63 lines
2.0 KiB
Lua

-- wall_hist.lua -- where does the run END UP, and does it keep changing?
--
-- Samples the PC once per emulated frame but only counts the window
-- [W_START, W_END], so the early boot/test phases do not pollute the histogram
-- of the final state. Prints a few timestamped PC snapshots so "stuck" is
-- supported by an across-time comparison, not one sample.
--
-- W_START=<frame> default 5000
-- W_END=<frame> default 20000
-- W_SNAP=<n> snapshot stride (default 2000)
-- W_OUT=<file> printable summary copy
--
-- <mame> vt1200 ... -debug -debugger none -debuglog \
-- VT1200_LOG_UNMAPPED=... VT1200_BOARD_LOG=... VT1200_DUARTLOG=... \
-- -autoboot_script harness/mame/wall_hist.lua -autoboot_delay 0
local machine = manager.machine
local dbg = machine.debugger
local cpu = machine.devices[':maincpu']
if not dbg then
print("ERROR: debugger not enabled; pass -debug")
machine:exit()
return
end
local wstart = tonumber(os.getenv("W_START") or "5000")
local wend = tonumber(os.getenv("W_END") or "20000")
local snap = tonumber(os.getenv("W_SNAP") or "2000")
local frames = 0
local hist, first, last = {}, {}, {}
emu.register_frame_done(function()
frames = frames + 1
local v = cpu.state['PC'].value
if frames >= wstart then
hist[v] = (hist[v] or 0) + 1
if not first[v] then first[v] = frames end
last[v] = frames
end
if frames % snap == 0 then
print(string.format("frame %6d PC=%08X", frames, v))
end
if frames >= wend then
local n = 0
for _ in pairs(hist) do n = n + 1 end
print(string.format("--- window [%d,%d]: distinct PCs=%d", wstart, wend, n))
print("--- hottest PCs ---")
local list = {}
for k, c in pairs(hist) do list[#list + 1] = {k, c} end
table.sort(list, function(a, b) return a[2] > b[2] end)
for i = 1, math.min(25, #list) do
print(string.format(" PC=%08X samples=%d first=%d last=%d",
list[i][1], list[i][2], first[list[i][1]], last[list[i][1]]))
end
machine:exit()
end
end, "vt1200-wall")
dbg.visible_cpu = cpu
dbg.execution_state = 'run'