Introduce Coco 3 Plus for MiSTer
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.
This commit is contained in:
1 parent
8b8cf72d1f
commit
cb40fed3b9
126 files changed
+12795
-528
No files matched your search
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compare actual SDC RAM and VDAC write-clock bindings at legal CPU boundaries."""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
from source_snapshot import original_sources
|
||||
|
||||
ROOT=Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def main():
|
||||
parser=argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('project',type=Path)
|
||||
parser.add_argument('output',type=Path)
|
||||
parser.add_argument('--suite',type=Path,required=True)
|
||||
args=parser.parse_args()
|
||||
output=args.output.resolve()
|
||||
if not output.is_relative_to((ROOT/'build').resolve()) or output.exists():
|
||||
parser.error('Use a new output inside build/')
|
||||
output.mkdir(parents=True)
|
||||
original=original_sources('coco3-mister')/'rtl/sdc.sv'
|
||||
candidate=args.project/'rtl/sdc.sv'
|
||||
core=args.project/'rtl/coco3fpga.sv'
|
||||
reference=original.read_text();reference=reference[reference.index('module sdc_dpram'):]
|
||||
text=candidate.read_text();text=text[text.index('module sdc_dpram'):]
|
||||
# Both CPU RAM address/data/enable expressions must remain identical.
|
||||
for field in ('address_b','data_b','wren_b'):
|
||||
pattern=r'\.'+field+r'\(([^\n]+)\)'
|
||||
if re.search(pattern,original.read_text()).group(1)!=re.search(pattern,candidate.read_text()).group(1):
|
||||
raise RuntimeError('SDC CPU port changed: '+field)
|
||||
instance=core.read_text().split('VDAC\tVDAC_inst (',1)[1].split(');',1)[0]
|
||||
clock=re.search(r'\.wrclock\s*\(\s*([^\)]+)\)',instance).group(1).strip()
|
||||
if clock!='~clk_sys':raise RuntimeError('Unexpected VDAC write phase')
|
||||
for field in ('data','wraddress'):
|
||||
baseline=(original_sources('coco3-mister')/'rtl/coco3fpga.sv').read_text().split('VDAC\tVDAC_inst (',1)[1].split(');',1)[0]
|
||||
pattern=r'\.'+field+r'\s*\(([^\n]+)\)'
|
||||
if re.search(pattern,baseline).group(1)!=re.search(pattern,instance).group(1):raise RuntimeError('VDAC payload changed')
|
||||
wren=re.search(r'\.wren\s*\(([^\n]+)\)',instance).group(1).strip()
|
||||
compact=re.sub(r'\s+','',wren)
|
||||
has_ssc=bool(re.search(r'\bssc_cartridge\s*#',core.read_text()))
|
||||
required='VDAC_EN&PH_2&ssc_palette_owner' if has_ssc else 'VDAC_EN&PH_2'
|
||||
if compact!=required:raise RuntimeError('Unexpected VDAC address ownership qualification')
|
||||
source=output/'actual-memory.sv'
|
||||
source.write_text(reference.replace('module sdc_dpram','module sdc_reference',1)+'\n'+text+
|
||||
'\nmodule actual_vdac_clock(input clk_sys,output q); assign q='+clock+'; endmodule\n'+
|
||||
'\nmodule actual_vdac_write(input PH_2,VDAC_EN,ssc_palette_owner,output q,output supports_ssc); assign q='+wren+
|
||||
"; assign supports_ssc=1'b"+str(int(has_ssc))+'; endmodule\n',encoding='utf-8')
|
||||
bench=ROOT/'tests/peripheral_phase_tb.sv'
|
||||
env=os.environ.copy();env['PATH']=os.pathsep.join([str(args.suite/'bin'),str(args.suite/'lib'),env['PATH']])
|
||||
ext='.exe' if os.name=='nt' else ''
|
||||
with (output/'compile.log').open('w') as log:
|
||||
subprocess.run([str(args.suite/'bin'/('iverilog'+ext)),'-g2012','-s','peripheral_phase_tb','-o',str(output/'test.vvp'),str(bench),str(source)],env=env,stdout=log,stderr=subprocess.STDOUT,check=True)
|
||||
with (output/'test.log').open('w') as log:
|
||||
subprocess.run([str(args.suite/'bin'/('vvp'+ext)),str(output/'test.vvp')],env=env,stdout=log,stderr=subprocess.STDOUT,check=True)
|
||||
print((output/'test.log').read_text())
|
||||
paths=[original,candidate,core,source,bench,Path(__file__),output/'test.log']
|
||||
(output/'test-result.json').write_text(json.dumps({'passed':True,'hardware_tested':False,'sha256':{str(p):hashlib.sha256(p.read_bytes()).hexdigest() for p in paths}},indent=2)+'\n',encoding='utf-8')
|
||||
|
||||
|
||||
if __name__=='__main__':main()
|
||||
Reference in new issue
Block a user