microvax_mem_test
Differences
This shows you the differences between two versions of the page.
| microvax_mem_test [2026/04/29 01:28] – created admin | microvax_mem_test [2026/04/29 01:29] (current) – admin | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| < | < | ||
| + | Script: | ||
| + | < | ||
| + | |||
| + | |||
| + | import serial | ||
| + | import time | ||
| + | import re | ||
| + | |||
| + | # Increase timeout and use a slightly slower baud rate if 9600 is flaky, | ||
| + | # but 9600 is usually standard. | ||
| + | ser = serial.Serial('/ | ||
| + | |||
| + | def vax_io(cmd): | ||
| + | # 1. Clear the buffer so we don't read old garbage | ||
| + | ser.reset_input_buffer() | ||
| + | | ||
| + | # 2. Send the command with a Carriage Return | ||
| + | ser.write(f" | ||
| + | | ||
| + | # 3. Wait for the VAX to finish. We look for the '>>>' | ||
| + | timeout = time.time() + 2 # 2 second safety timeout | ||
| + | full_resp = "" | ||
| + | while ">>>" | ||
| + | if ser.in_waiting > 0: | ||
| + | full_resp += ser.read(ser.in_waiting).decode(errors=' | ||
| + | if time.time() > timeout: | ||
| + | break | ||
| + | time.sleep(0.05) | ||
| + | | ||
| + | return full_resp | ||
| + | |||
| + | def test_onboard_full_map(): | ||
| + | start = 0x00300000 | ||
| + | end = 0x003FFFFF | ||
| + | error_count = 0 | ||
| + | | ||
| + | print(f" | ||
| + | | ||
| + | # We'll use a slightly larger step (e.g., 1KB) if you want a fast map, | ||
| + | # or keep it at 4 to check every single longword. | ||
| + | for addr in range(start, | ||
| + | addr_hex = f" | ||
| + | | ||
| + | # Test pattern: All zeros then all ones | ||
| + | for pat in [0x00000000, | ||
| + | pat_hex = f" | ||
| + | | ||
| + | vax_io(f" | ||
| + | resp = vax_io(f" | ||
| + | | ||
| + | match = re.search(r" | ||
| + | | ||
| + | if match: | ||
| + | received_val = match.group(1).upper() | ||
| + | if received_val != pat_hex: | ||
| + | error_count += 1 | ||
| + | print(f" | ||
| + | print(f" | ||
| + | | ||
| + | # If we get too many errors, the board might be totally dead | ||
| + | if error_count > 100: | ||
| + | print(" | ||
| + | return | ||
| + | |||
| + | if addr % 0x1000 == 0: | ||
| + | print(f" | ||
| + | |||
| + | print(f" | ||
| + | |||
| + | # Clear the screen on the VAX first | ||
| + | vax_io(" | ||
| + | test_onboard_full_map() | ||
| + | </ | ||
microvax_mem_test.1777426086.txt.gz · Last modified: by admin
