Add original-firmware Sound & Speech, four configurable Multi-Pak sockets, bounded per-slot ROM allocation and a nine-page menu organized around devices and media. Repair inherited clock/reset/CPU-memory/video paths and add explicit conditional external-I/O timing contracts. Preserve native Main startup-file ordering, saved layouts, stock-core separation and the coco3plus media profile. Provide native Windows tool downloads, pinned ToolShed ROM assembly, fresh Quartus builds, functional and fitted timing checks, reviewed release packaging and passwordless SSH installation with backups. Retain original component notices, document contribution copyright and keep SSC ROM inputs outside Git. Validation: Quartus17.0.2 Build602 seed5, zero errors; 15 functional jobs, 368 both-corner timing scopes and eight tooling-integrity checks pass. The renamed build reaches Disk BASIC, PRINT1+1 returns2 and SSC loads ready. Physical cold power cycling and conditional board-delay assumptions remain separate. Full original upstream histories are preserved before this single consolidated implementation commit.
55 lines
2.7 KiB
Python
55 lines
2.7 KiB
Python
#!/usr/bin/env python3
|
|
"""Check AS4C32M16SB -7 command minima on actual controller pin commands."""
|
|
import argparse
|
|
import hashlib
|
|
import json
|
|
import os
|
|
from pathlib import Path
|
|
import subprocess
|
|
from test_video_sdram import normalize_controller
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
def main():
|
|
p = argparse.ArgumentParser(description=__doc__)
|
|
p.add_argument('project', type=Path)
|
|
p.add_argument('output', type=Path)
|
|
p.add_argument('--suite', type=Path, required=True)
|
|
p.add_argument('--expect-legacy-failures', action='store_true')
|
|
a = p.parse_args()
|
|
out = a.output.resolve()
|
|
if not out.is_relative_to(ROOT / 'build') or out.exists():
|
|
p.error('Use a new build/ directory')
|
|
out.mkdir(parents=True)
|
|
source = a.project / 'rtl/sdram/sdram2.sv'
|
|
(out / 'controller.sv').write_text(normalize_controller(source.read_text(), 'sdram_probe'))
|
|
env = os.environ.copy()
|
|
env['PATH'] = os.pathsep.join([str(a.suite / 'bin'), str(a.suite / 'lib'), env['PATH']])
|
|
ext = '.exe' if os.name == 'nt' else ''
|
|
cmd = [str(a.suite / 'bin' / ('iverilog' + ext)), '-g2012', '-s', 'external_sdram_commands_tb', '-o', str(out / 'run.vvp'),
|
|
str(ROOT / 'tests/external_sdram_commands_tb.sv'), str(out / 'controller.sv')]
|
|
with (out / 'compile.log').open('w') as log:
|
|
subprocess.run(cmd, env=env, stdout=log, stderr=subprocess.STDOUT, check=True)
|
|
results = {}
|
|
for tag, extra, signature in [('startup', [], 'SDRAM startup below 200 us'),
|
|
('recovery', ['+IGNORE_STARTUP'], 'SDRAM tRC below 63 ns'),
|
|
('refresh', ['+IGNORE_STARTUP', '+IGNORE_TRC'], 'SDRAM refresh interval above 7812.5 ns')]:
|
|
with (out / f'{tag}.log').open('w') as log:
|
|
r = subprocess.run([str(a.suite / 'bin' / ('vvp' + ext)), str(out / 'run.vvp'), *extra], env=env,
|
|
stdout=log, stderr=subprocess.STDOUT, timeout=60)
|
|
text = (out / f'{tag}.log').read_text()
|
|
print(text, end='')
|
|
if a.expect_legacy_failures:
|
|
assert r.returncode != 0 and signature in text
|
|
else:
|
|
assert r.returncode == 0 and 'PASS SDRAM command intervals' in text
|
|
results[tag] = {'exit_code': r.returncode, 'log_sha256': hashlib.sha256((out / f'{tag}.log').read_bytes()).hexdigest()}
|
|
(out / 'result.json').write_text(json.dumps({'source_sha256': hashlib.sha256(source.read_bytes()).hexdigest(),
|
|
'legacy_failures_reproduced': a.expect_legacy_failures, 'command_checks_passed': not a.expect_legacy_failures,
|
|
'scope': 'digital pin-command intervals, no physical read data or analog timing', 'results': results}, indent=2) + '\n')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|