diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ccccfe --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +# Preserve all imported RTL, firmware data and generated records byte-for-byte. +* -text +* whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol +*.md text eol=lf +*.py text eol=lf +*.ps1 text eol=lf +*.rbf -text -diff -merge +*.png -text -diff -merge +*.DSK -text -diff -merge +*.bin -text -diff -merge +*.rom -text -diff -merge diff --git a/.gitignore b/.gitignore index bf52556..9d76e83 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,23 @@ -db -incremental_db -output_files +# Local tools, downloaded sources and generated build/install payloads. +/.tools/ +/.deps/ +/.cache/ +/build/ +/dist/ +# Firmware is obtained separately. Never commit original SSC ROM inputs. +/roms/** +!/roms/README.md +__pycache__/ +*.pyc +.DS_Store +Thumbs.db +# Quartus work products stay in build/ copies. +db/ +incremental_db/ +output_files/ build_id.v c5_pin_model_dump.txt jtag.cdf -*.zip *.bak /*.qws -greybox_tmp/cbx_args.txt -*/greybox_tmp/cbx_args.txt -changes.txt -rtl/config_inc.sv +greybox_tmp/ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..88c30ab --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,30 @@ +# Coco 3 Plus MiSTer development + +Read README.md and docs/VALIDATION.md first. Keep documentation of fixes, +commands, tool versions, artifact hashes and actual test results in the repository. +Distinguish source inspection, simulation, static timing and physical observations. + +This repository is the authoritative MiSTer project. Original upstream history, +notices and baseline commit are preserved. Do not refresh snapshots over local +edits. Review upstream changes deliberately. The DE1 research port is separate. + +Build in fresh ignored build/ copies with Quartus17.0.2 Build602. Add HDL through +files.qip and the maintained tools/project_inputs.json inventory. Do not upgrade generated IP, widen timing exceptions or change FPGA +source merely to make a test pass. Run meaningful regressions and both-corner +fitted timing checks for relevant changes. A pass under the conditional SDRAM +profile is not a universal electrical qualification. + +Keep SSC ROMs and other local binary inputs ignored. Do not commit credentials, +device addresses, private conversations or build caches. Preserve existing +copyright/license notices and state unresolved provenance honestly. Do not claim +independent clean-room implementation after reading source references. + +Keep a known-good core and user configuration on the target. Use distinct +bitstreams, checked installation manifests and rollback copies. Do not reimage +cards or program nonvolatile hardware incidentally during core testing. Save +guest work before resetting or reloading. Do not claim a build, installation, +listening check or cold power-cycle that was not observed. + +Use native Windows and portable Python tools; do not assume Bash/WSL. Do not +spawn additional agents unless explicitly requested. Commit/push when instructed, +preserving unrelated work and reporting the resulting revision. diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a9a43a6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,23 @@ +# Consolidated Plus implementation + +Based on complete upstream history through +8b8cf72d1fb4de1d05345de8d5b92ec2d500fcd2. + +- Added original-firmware Sound & Speech hardware, runtime chip-ROM loading, + readiness/error reporting and exclusive SSC/extended-palette register ownership. +- Added four configurable Multi-Pak sockets, independent routing/banks, singleton + built-in device moves and a bounded shared program-ROM pool. +- Reorganized controls into nine stable VCC Plus-inspired pages while preserving + floppy, SDC/OS9, cassette, audio, video, input, UART and machine functions. +- Repaired clock/reset/phase boundaries, CPU/SDRAM handshakes, video activation + timing and source-matched external-I/O constraints under the documented profile. +- Corrected early remembered-ROM loading and deferred status normalization for + saved non-default layouts with the unmodified MiSTer Main initialization order. +- Added independent Windows tool downloads, ToolShed ROM assembly, fresh native + Quartus builds, functional/fitted timing checks, copyable release overlays and + checked passwordless-SSH installation with rollback. +- Preserved original history/attribution and documented contribution licensing, + assumptions, ROM requirements, test results and remaining physical limits. + +See docs/BUG_FIXES.md for causes/checks, docs/FEATURES.md for behavior, +docs/MENUS.md for the complete tree and docs/VALIDATION.md for acceptance scope. diff --git a/COPYRIGHT.md b/COPYRIGHT.md new file mode 100644 index 0000000..b7bea95 --- /dev/null +++ b/COPYRIGHT.md @@ -0,0 +1,148 @@ +# Copyright of Plus contributions + +Copyright (c) 2026 Brian K. Holman. All rights reserved. + +This notice identifies original Coco 3 Plus work and original modifications. +Those contributions are licensed under LICENSES/Coco3Plus-BSD-3-Clause.txt. +It does not claim ownership of inherited code, reference algorithms, extracted +third-party functions, ROMs, generated vendor IP or GNU license texts. Original +copyright and component licenses remain in force; see LICENSING.md and NOTICE.md. + +For compiled source kept byte-identical to the qualified build, this file is +the accompanying contribution copyright notice. Existing source headers remain +intact. A file-level listing identifies the contribution scope without replacing +the original author's notice. Line-ending-only changes are not new authorship. + +## Modified inherited files + +The notice covers only original Plus modifications in these files: + +- `.gitignore` +- `CoCo3.qsf` +- `CoCo3.sv` +- `README.md` +- `files.qip` +- `rtl/CoCo3FPGA.sdc` +- `rtl/EE_Cold_Bt.v` +- `rtl/UART_6551/6551rx.v` +- `rtl/UART_6551/uart_6551.v` +- `rtl/coco3fpga.sv` +- `rtl/fdc.sv` +- `rtl/mc6809glb/mc6809glb.v` +- `rtl/sdc.sv` +- `rtl/sdc_top.sv` +- `rtl/sdram/sdram2.sv` +- `sys/i2c.v` +- `sys/mcp23009.sv` + +## New project files + +The notice covers original Plus portions of the following new files. Derived +SSC algorithms retain the MAME component attribution in rtl/ssc/LICENSE; +references and third-party excerpts retain their own terms. + +- `.gitattributes` +- `AGENTS.md` +- `CHANGELOG.md` +- `COPYRIGHT.md` +- `LICENSES/Coco3Plus-BSD-3-Clause.txt` +- `LICENSING.md` +- `NOTICE.md` +- `docs/BUG_FIXES.md` +- `docs/BUILD_WINDOWS.md` +- `docs/FEATURES.md` +- `docs/INSTALL.md` +- `docs/MENUS.md` +- `docs/SD_IMAGE.md` +- `docs/VALIDATION.md` +- `external-io.sdc` +- `reset-cpu.sdc` +- `roms/README.md` +- `rtl/bh_mpi_config.sv` +- `rtl/bh_mpi_rom.sv` +- `rtl/bh_mpi_router.sv` +- `rtl/cpu_sdram_bridge.sv` +- `rtl/ssc/LICENSE` +- `rtl/ssc/ssc_audio.sv` +- `rtl/ssc/ssc_ay8913.sv` +- `rtl/ssc/ssc_cartridge.sv` +- `rtl/ssc/ssc_glue.sv` +- `rtl/ssc/ssc_host.sv` +- `rtl/ssc/ssc_mister_bridge.sv` +- `rtl/ssc/ssc_sp0256.sv` +- `rtl/ssc/ssc_sp0256_memory.sv` +- `rtl/ssc/ssc_sp0256_tables.vh` +- `rtl/ssc/ssc_tms7000.sv` +- `rtl/ssc/ssc_tms7000_alu.sv` +- `rtl/ssc/ssc_tms7000_bcd.sv` +- `rtl/ssc/ssc_tms7000_decode.sv` +- `rtl/ssc/ssc_tms7000_defs.vh` +- `rtl/ssc/ssc_tms7000_exec.sv` +- `rtl/ssc/ssc_tms7000_io.sv` +- `rtl/ssc/ssc_tms7000_memory.sv` +- `rtl/ssc/ssc_tms7000_pacer.sv` +- `scripts/bh_mpi_timing.tcl` +- `scripts/coco3_bh_profile.py` +- `scripts/external_io_timing.tcl` +- `scripts/nmi_timing_paths.tcl` +- `scripts/reset_cpu_timing_paths.tcl` +- `scripts/rom_inputs.py` +- `scripts/run_regressions.py` +- `scripts/source_snapshot.py` +- `scripts/ssc_integrated_timing.tcl` +- `scripts/test_bh_menu.py` +- `scripts/test_bh_mpi.py` +- `scripts/test_bh_mpi_core.py` +- `scripts/test_coco3_bh_startup.py` +- `scripts/test_external_audio.py` +- `scripts/test_external_i2c.py` +- `scripts/test_external_pixel.py` +- `scripts/test_external_sdram.py` +- `scripts/test_external_sdram_commands.py` +- `scripts/test_keyboard_control_phase.py` +- `scripts/test_peripheral_phase.py` +- `scripts/test_registered_interfaces.py` +- `scripts/test_reset_domains.py` +- `scripts/test_ssc_mister_system.py` +- `scripts/test_video_sdram.py` +- `scripts/uart_timing_paths.tcl` +- `scripts/validation_common.py` +- `scripts/video_timing_paths.tcl` +- `tests/bh_mpi_core_tb.sv` +- `tests/bh_mpi_startup_tb.sv` +- `tests/bh_mpi_tb.sv` +- `tests/boot_control_tb.sv` +- `tests/bridge_protocol_tb.sv` +- `tests/completion_phase_tb.sv` +- `tests/cpu_sdram_bridge_tb.sv` +- `tests/disk_buffer_pipeline_tb.sv` +- `tests/external_audio_tb.sv` +- `tests/external_i2c_tb.sv` +- `tests/external_sdram_commands_tb.sv` +- `tests/keyboard_control_phase_tb.sv` +- `tests/peripheral_phase_tb.sv` +- `tests/reset_domains_tb.sv` +- `tests/ssc_mister_system_tb.sv` +- `tests/test_release_guards.py` +- `tests/test_tooling_guards.py` +- `tests/video_sdram_tb.sv` +- `tools/audit_timing.py` +- `tools/bootstrap.py` +- `tools/build_fpga.py` +- `tools/build_roms.py` +- `tools/cocoroms.json` +- `tools/install_mister.py` +- `tools/project_inputs.json` +- `tools/release.py` +- `tools/timing_coverage.py` +- `tools/toolchain.json` +- `uart-reset.sdc` +- `windows/Build-FPGA.ps1` +- `windows/Build-ROMs.ps1` +- `windows/Install-MiSTer.ps1` +- `windows/Package-Release.ps1` +- `windows/Setup-Tools.ps1` +- `windows/Test.ps1` + +Copyright notices also accompany synthesized releases through NOTICE.md, +LICENSING.md, this inventory and the original component license texts. diff --git a/CoCo3.qsf b/CoCo3.qsf index 955abeb..ffb5a44 100644 --- a/CoCo3.qsf +++ b/CoCo3.qsf @@ -1,180 +1,195 @@ -# -------------------------------------------------------------------------- -# -# MiSTer project -# -# WARNING WARNING WARNING: -# Do not add files to project in Quartus IDE! It will mess this file! -# Add the files manually to files.qip file. -# -# -------------------------------------------------------------------------- - -set_global_assignment -name TOP_LEVEL_ENTITY sys_top -set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top -set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top -set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top - -set_global_assignment -name LAST_QUARTUS_VERSION "17.0.2 Lite Edition" - -set_global_assignment -name GENERATE_RBF_FILE ON -set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files -set_global_assignment -name NUM_PARALLEL_PROCESSORS ALL -set_global_assignment -name SAVE_DISK_SPACE OFF -set_global_assignment -name SMART_RECOMPILE ON -set_global_assignment -name MIN_CORE_JUNCTION_TEMP "-40" -set_global_assignment -name MAX_CORE_JUNCTION_TEMP 100 -set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW" -set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)" -set_global_assignment -name TIMEQUEST_MULTICORNER_ANALYSIS OFF -set_global_assignment -name OPTIMIZE_POWER_DURING_FITTING OFF -set_global_assignment -name FINAL_PLACEMENT_OPTIMIZATION ALWAYS -set_global_assignment -name FITTER_EFFORT "STANDARD FIT" -set_global_assignment -name OPTIMIZATION_MODE "HIGH PERFORMANCE EFFORT" -set_global_assignment -name ALLOW_POWER_UP_DONT_CARE ON -set_global_assignment -name QII_AUTO_PACKED_REGISTERS NORMAL -set_global_assignment -name ROUTER_LCELL_INSERTION_AND_LOGIC_DUPLICATION ON -set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC ON -set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION ON -set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING ON -set_global_assignment -name OPTIMIZATION_TECHNIQUE SPEED -set_global_assignment -name MUX_RESTRUCTURE ON -set_global_assignment -name REMOVE_REDUNDANT_LOGIC_CELLS ON -set_global_assignment -name AUTO_DELAY_CHAINS_FOR_HIGH_FANOUT_INPUT_PINS ON -set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC_FOR_AREA ON -set_global_assignment -name ADV_NETLIST_OPT_SYNTH_WYSIWYG_REMAP ON -set_global_assignment -name SYNTH_GATED_CLOCK_CONVERSION ON -set_global_assignment -name PRE_MAPPING_RESYNTHESIS ON -set_global_assignment -name ROUTER_CLOCKING_TOPOLOGY_ANALYSIS ON -set_global_assignment -name ECO_OPTIMIZE_TIMING ON -set_global_assignment -name PERIPHERY_TO_CORE_PLACEMENT_AND_ROUTING_OPTIMIZATION ON -set_global_assignment -name PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING ON -set_global_assignment -name ALM_REGISTER_PACKING_EFFORT MEDIUM -set_global_assignment -name SEED 1 - -#set_global_assignment -name VERILOG_MACRO "MISTER_FB=1" - -#enable it only if 8bit indexed mode is used in core -#set_global_assignment -name VERILOG_MACRO "MISTER_FB_PALETTE=1" - -#do not enable DEBUG_NOHDMI in release! -#set_global_assignment -name VERILOG_MACRO "MISTER_DEBUG_NOHDMI=1" - -# disable bilinear filtering when downscaling -#set_global_assignment -name VERILOG_MACRO "MISTER_DOWNSCALE_NN=1" - -# disable adaptive scanline filtering -#set_global_assignment -name VERILOG_MACRO "MISTER_DISABLE_ADAPTIVE=1" - -#use only 1MB per frame for scaler to free ~21MB DDR3 RAM -#set_global_assignment -name VERILOG_MACRO "MISTER_SMALL_VBUF=1" - -# Disable YC / Composite output to save some resources -#set_global_assignment -name VERILOG_MACRO "MISTER_DISABLE_YC=1" - -# Disable ALSA audio output to save some resources -#set_global_assignment -name VERILOG_MACRO "MISTER_DISABLE_ALSA=1" - -source sys/sys.tcl -source sys/sys_analog.tcl -source files.qip -set_global_assignment -name ENABLE_SIGNALTAP ON -set_global_assignment -name USE_SIGNALTAP_FILE Video1.stp -set_global_assignment -name SLD_NODE_CREATOR_ID 110 -section_id Video1 -set_global_assignment -name SLD_NODE_ENTITY_NAME sld_signaltap -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_clk -to "emu:emu|video_mixer:video_mixer|CLK_VIDEO" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[0] -to "emu:emu|VGA_DE" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[1] -to "emu:emu|VGA_F1" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[2] -to "emu:emu|VGA_G[7]" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[3] -to "emu:emu|VGA_HS" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[4] -to "emu:emu|VGA_VS" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[5] -to "emu:emu|video_mixer:video_mixer|HBlank" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[6] -to "emu:emu|video_mixer:video_mixer|HSync" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[7] -to "emu:emu|video_mixer:video_mixer|VBlank" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[8] -to "emu:emu|video_mixer:video_mixer|VSync" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[9] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|ce_pix" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[10] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|ctr[0]" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[11] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|ctr[1]" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[12] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|hb" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[13] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|hs" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[14] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|old_ce" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[15] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|vb" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[16] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|vs" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[17] -to "emu:emu|video_mixer:video_mixer|video_freezer:freezer|hs_out" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[18] -to "emu:emu|video_mixer:video_mixer|video_freezer:freezer|vs_out" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[0] -to "emu:emu|VGA_DE" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[1] -to "emu:emu|VGA_F1" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[2] -to "emu:emu|VGA_G[7]" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[3] -to "emu:emu|VGA_HS" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[4] -to "emu:emu|VGA_VS" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[5] -to "emu:emu|video_mixer:video_mixer|HBlank" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[6] -to "emu:emu|video_mixer:video_mixer|HSync" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[7] -to "emu:emu|video_mixer:video_mixer|VBlank" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[8] -to "emu:emu|video_mixer:video_mixer|VSync" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[9] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|ce_pix" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[10] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|ctr[0]" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[11] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|ctr[1]" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[12] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|hb" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[13] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|hs" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[14] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|old_ce" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[15] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|vb" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[16] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|vs" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[17] -to "emu:emu|video_mixer:video_mixer|video_freezer:freezer|hs_out" -section_id Video1 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[18] -to "emu:emu|video_mixer:video_mixer|video_freezer:freezer|vs_out" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_RAM_BLOCK_TYPE=AUTO" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_DATA_BITS=19" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_BITS=19" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_BITS=19" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_NODE_INFO=805334528" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_POWER_UP_TRIGGER=0" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INVERSION_MASK=000000000000000000000000000000000000000000000000000000000000000000000000000000000000" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INVERSION_MASK_LENGTH=84" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_INVERSION_MASK_LENGTH=0" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_SEGMENT_SIZE=8192" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ATTRIBUTE_MEM_MODE=OFF" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STATE_FLOW_USE_GENERATED=0" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STATE_BITS=11" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_BUFFER_FULL_STOP=1" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_CURRENT_RESOURCE_WIDTH=1" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INCREMENTAL_ROUTING=1" -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[0] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[1] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[2] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[3] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[4] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[5] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[6] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[7] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[8] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[9] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[10] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[11] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[12] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[13] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[14] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[15] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[16] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[17] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[18] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[19] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[20] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[21] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[22] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[23] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[24] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[25] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[26] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[27] -to Video1|gnd -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[28] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[29] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[30] -to Video1|vcc -section_id Video1 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[31] -to Video1|gnd -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_LEVEL=1" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_SAMPLE_DEPTH=8192" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_IN_ENABLED=0" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_PIPELINE=0" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_RAM_PIPELINE=0" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_COUNTER_PIPELINE=0" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ADVANCED_TRIGGER_ENTITY=basic,1," -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_LEVEL_PIPELINE=1" -section_id Video1 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ENABLE_ADVANCED_TRIGGER=0" -section_id Video1 -set_global_assignment -name SLD_FILE db/Video1_auto_stripped.stp -set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top \ No newline at end of file +# Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +# Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +# -------------------------------------------------------------------------- +# +# MiSTer project +# +# WARNING WARNING WARNING: +# Do not add files to project in Quartus IDE! It will mess this file! +# Add the files manually to files.qip file. +# +# -------------------------------------------------------------------------- + +set_global_assignment -name TOP_LEVEL_ENTITY sys_top +set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top +set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top +set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top + +set_global_assignment -name LAST_QUARTUS_VERSION "17.0.2 Lite Edition" + +set_global_assignment -name GENERATE_RBF_FILE ON +set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files +set_global_assignment -name NUM_PARALLEL_PROCESSORS ALL +set_global_assignment -name SAVE_DISK_SPACE OFF +set_global_assignment -name SMART_RECOMPILE ON +set_global_assignment -name MIN_CORE_JUNCTION_TEMP "-40" +set_global_assignment -name MAX_CORE_JUNCTION_TEMP 100 +set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW" +set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)" +set_global_assignment -name TIMEQUEST_MULTICORNER_ANALYSIS OFF +set_global_assignment -name OPTIMIZE_POWER_DURING_FITTING OFF +set_global_assignment -name FINAL_PLACEMENT_OPTIMIZATION ALWAYS +set_global_assignment -name FITTER_EFFORT "STANDARD FIT" +set_global_assignment -name OPTIMIZATION_MODE "HIGH PERFORMANCE EFFORT" +set_global_assignment -name ALLOW_POWER_UP_DONT_CARE ON +set_global_assignment -name QII_AUTO_PACKED_REGISTERS NORMAL +set_global_assignment -name ROUTER_LCELL_INSERTION_AND_LOGIC_DUPLICATION ON +set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC ON +set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION ON +set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING OFF +set_global_assignment -name OPTIMIZATION_TECHNIQUE SPEED +set_global_assignment -name MUX_RESTRUCTURE ON +set_global_assignment -name REMOVE_REDUNDANT_LOGIC_CELLS ON +set_global_assignment -name AUTO_DELAY_CHAINS_FOR_HIGH_FANOUT_INPUT_PINS ON +set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC_FOR_AREA ON +set_global_assignment -name ADV_NETLIST_OPT_SYNTH_WYSIWYG_REMAP ON +set_global_assignment -name SYNTH_GATED_CLOCK_CONVERSION ON +set_global_assignment -name PRE_MAPPING_RESYNTHESIS ON +set_global_assignment -name ROUTER_CLOCKING_TOPOLOGY_ANALYSIS ON +set_global_assignment -name ECO_OPTIMIZE_TIMING ON +set_global_assignment -name PERIPHERY_TO_CORE_PLACEMENT_AND_ROUTING_OPTIMIZATION ON +set_global_assignment -name PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING ON +set_global_assignment -name ALM_REGISTER_PACKING_EFFORT MEDIUM +# Reproducible SSC candidate placement; no timing exception or protocol change. +set_global_assignment -name SEED 5 + +#set_global_assignment -name VERILOG_MACRO "MISTER_FB=1" + +#enable it only if 8bit indexed mode is used in core +#set_global_assignment -name VERILOG_MACRO "MISTER_FB_PALETTE=1" + +#do not enable DEBUG_NOHDMI in release! +#set_global_assignment -name VERILOG_MACRO "MISTER_DEBUG_NOHDMI=1" + +# disable bilinear filtering when downscaling +#set_global_assignment -name VERILOG_MACRO "MISTER_DOWNSCALE_NN=1" + +# disable adaptive scanline filtering +#set_global_assignment -name VERILOG_MACRO "MISTER_DISABLE_ADAPTIVE=1" + +#use only 1MB per frame for scaler to free ~21MB DDR3 RAM +#set_global_assignment -name VERILOG_MACRO "MISTER_SMALL_VBUF=1" + +# Disable YC / Composite output to save some resources +#set_global_assignment -name VERILOG_MACRO "MISTER_DISABLE_YC=1" + +# Disable ALSA audio output to save some resources +#set_global_assignment -name VERILOG_MACRO "MISTER_DISABLE_ALSA=1" + +source sys/sys.tcl +source sys/sys_analog.tcl +source files.qip +set_global_assignment -name ENABLE_SIGNALTAP ON +set_global_assignment -name USE_SIGNALTAP_FILE Video1.stp +set_global_assignment -name SLD_NODE_CREATOR_ID 110 -section_id Video1 +set_global_assignment -name SLD_NODE_ENTITY_NAME sld_signaltap -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_clk -to "emu:emu|video_mixer:video_mixer|CLK_VIDEO" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[0] -to "emu:emu|VGA_DE" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[1] -to "emu:emu|VGA_F1" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[2] -to "emu:emu|VGA_G[7]" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[3] -to "emu:emu|VGA_HS" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[4] -to "emu:emu|VGA_VS" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[5] -to "emu:emu|video_mixer:video_mixer|HBlank" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[6] -to "emu:emu|video_mixer:video_mixer|HSync" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[7] -to "emu:emu|video_mixer:video_mixer|VBlank" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[8] -to "emu:emu|video_mixer:video_mixer|VSync" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[9] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|ce_pix" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[10] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|ctr[0]" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[11] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|ctr[1]" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[12] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|hb" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[13] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|hs" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[14] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|old_ce" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[15] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|vb" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[16] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|vs" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[17] -to "emu:emu|video_mixer:video_mixer|video_freezer:freezer|hs_out" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[18] -to "emu:emu|video_mixer:video_mixer|video_freezer:freezer|vs_out" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[0] -to "emu:emu|VGA_DE" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[1] -to "emu:emu|VGA_F1" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[2] -to "emu:emu|VGA_G[7]" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[3] -to "emu:emu|VGA_HS" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[4] -to "emu:emu|VGA_VS" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[5] -to "emu:emu|video_mixer:video_mixer|HBlank" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[6] -to "emu:emu|video_mixer:video_mixer|HSync" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[7] -to "emu:emu|video_mixer:video_mixer|VBlank" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[8] -to "emu:emu|video_mixer:video_mixer|VSync" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[9] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|ce_pix" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[10] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|ctr[0]" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[11] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|ctr[1]" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[12] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|hb" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[13] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|hs" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[14] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|old_ce" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[15] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|vb" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[16] -to "emu:emu|video_mixer:video_mixer|gamma_corr:gamma|vs" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[17] -to "emu:emu|video_mixer:video_mixer|video_freezer:freezer|hs_out" -section_id Video1 +set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[18] -to "emu:emu|video_mixer:video_mixer|video_freezer:freezer|vs_out" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_RAM_BLOCK_TYPE=AUTO" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_DATA_BITS=19" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_BITS=19" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_BITS=19" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_NODE_INFO=805334528" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_POWER_UP_TRIGGER=0" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INVERSION_MASK=000000000000000000000000000000000000000000000000000000000000000000000000000000000000" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INVERSION_MASK_LENGTH=84" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_INVERSION_MASK_LENGTH=0" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_SEGMENT_SIZE=8192" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ATTRIBUTE_MEM_MODE=OFF" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STATE_FLOW_USE_GENERATED=0" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STATE_BITS=11" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_BUFFER_FULL_STOP=1" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_CURRENT_RESOURCE_WIDTH=1" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INCREMENTAL_ROUTING=1" -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[0] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[1] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[2] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[3] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[4] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[5] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[6] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[7] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[8] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[9] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[10] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[11] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[12] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[13] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[14] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[15] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[16] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[17] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[18] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[19] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[20] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[21] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[22] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[23] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[24] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[25] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[26] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[27] -to Video1|gnd -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[28] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[29] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[30] -to Video1|vcc -section_id Video1 +set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[31] -to Video1|gnd -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_LEVEL=1" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_SAMPLE_DEPTH=8192" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_IN_ENABLED=0" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_PIPELINE=0" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_RAM_PIPELINE=0" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_COUNTER_PIPELINE=0" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ADVANCED_TRIGGER_ENTITY=basic,1," -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_LEVEL_PIPELINE=1" -section_id Video1 +set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ENABLE_ADVANCED_TRIGGER=0" -section_id Video1 +set_global_assignment -name SLD_FILE db/Video1_auto_stripped.stp +set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top +set_global_assignment -name SDC_FILE uart-reset.sdc + +# Research: low-skew routing for the high-fanout synchronous release. +set_instance_assignment -name GLOBAL_SIGNAL GLOBAL_CLOCK -to "emu|coco3|reset_main_release[1]" +set_instance_assignment -name MAX_FANOUT 8 -to "emu|cpu_memory_boundary|memory_req" +set_instance_assignment -name MAX_FANOUT 4 -to "emu|coco3|GLBCPU09|InstPage3" +set_global_assignment -name NUM_PARALLEL_PROCESSORS 1 +set_global_assignment -name SDC_FILE reset-cpu.sdc +set_global_assignment -name SDC_FILE external-io.sdc +# Physical clock-output delay, not a timing waiver. Verify D5=16 in the fitted +# Delay Chain Summary and slow/fast read setup+hold before accepting an image. +set_instance_assignment -name D5_DELAY 16 -to SDRAM_CLK diff --git a/CoCo3.sv b/CoCo3.sv index 7e73b87..a029af8 100644 --- a/CoCo3.sv +++ b/CoCo3.sv @@ -1,3 +1,5 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. //============================================================================ // CoCo3 port to MiSTer // Copyright (c) 2019 Alan Steremberg - alanswx, Stan Hodge - MasterS3263827 @@ -196,70 +198,80 @@ assign VIDEO_ARY = (!ar) ? 12'd3 : 12'd0; `include "build_id_num.v" localparam CONF_STR = { - "COCO3;UART19200:9600:4800:2400:1200:300;", - "-;", - "OCD,Multi-Pak,(Slot 2) CoCoSDC,(Slot3) ECB /Cart,(Slot 4) Disk;", - "H3-;", - "H3S2,DSK,Load Disk Drive 0;", - "H3S3,DSK,Load Disk Drive 1;", - "H3S4,DSK,Load Disk Drive 2;", - "H3S5,DSK,Load Disk Drive 3;", - "H2-;", - "H2F1,CCC,Load Cartridge;", - "H1-;", - "H1S0,DSKVHD,Load SDC Drive 0;", - "H1S1,DSKVHD,Load SDC Drive 1;", - "H1-;", - "H1S2,DSK,Load OS9 Floppy /d0;", - "H1S3,DSK,Load OS9 Floppy /d1;", - "H1S4,DSK,Load OS9 Floppy /d3;", - "H1S5,DSK,Load OS9 Floppy /d4;", - "-;", - - "F2,CAS,Load Cassette;", - "TF,Stop & Rewind;", - "OH,Monitor Tape Sound,No,Yes;", - "-;", - "S6,CAS,Save Cassette;", - "OE,Cass Rwd=0 / Rec=1,0,1;", - "-;", - - "P1,Video Settings;", - "P1-;", - "P1-, -= Video Settings =-;", - "P1-;", - "P1O89,Aspect ratio,Original,Full Screen,Wide,[ARC1];", - "P1O35,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%,CRT 75%;", - "P1-;", - "P1OL,CoCo3 LC,Yes,No-(SG6=Yes);", - "P1-;", - "P1o56,Artifact Type,MESS,Simple,NONE;", - "P1OI,Artifact Color Set,0,1;", - "-;", - "P2,Debug Menu;", - "P2-;", - "P2-, -= Debug Menu =-;", - "P2-;", - "P2F3,BIN,Load COCO Font;", - "P2OG,Swap MiSTer Uart,RS CART,Default;", - "P2OU,Swap Uart to IO,RS IO,MiSTer;", - "P2OT,Display Debug,Off,On;", - "-;", - "ON,D-Pad Joystick emu,No,Yes;", - "O6,Swap Joysticks,Off,On;", - "OS,Use Mouse for Rt Joystk,Off,On;", - "RA,Easter Egg;", - "-;", - "OO,Force Turbo,No,Yes;", - "o02,Turbo Speed,CoCo Ctrl, 0.89 Mhz,1.78 Mhz,2.86 Mhz, 3.58 Mhz,7.16 Mhz,9.54 Mhz;", - "OPR,Memory Size,512K,1M,2M,16M;", - "o89,Auto Run,No,DOS,AUTO.BAS;", - "-;", - "RM,Cold Boot;", - "R0,Reset;", + "Coco 3 Plus;UART19200:9600:4800:2400:1200:300;", + // Native remembered-file records are deliberately independent of pages. + "H0FC1,CCCROMBIN,Legacy cartridge;", + "H4FC4,BINROM,Load SSC controller (4K);", + "H4FC5,BINROM,Load SSC voice (2K);", + "P1,Cartridges & Multi-Pak;", + "P1OCD,Startup slot,Slot 1,Slot 2,Slot 3,Slot 4;", + "P1-,Built-in devices move slots;", + "P1-,Changes restart the CoCo;", + "P1oBD,Slot 1,Empty,ROM file,Floppy,CoCo SDC,Sound & Speech,Orchestra90,Audio expansions,RS232;", + "H8P1FC6,CCCROMBIN,Slot 1 ROM;", + "P1oEG,Slot 2,Empty,ROM file,Floppy,CoCo SDC,Sound & Speech,Orchestra90,Audio expansions,RS232;", + "H9P1FC7,CCCROMBIN,Slot 2 ROM;", + "P1oHJ,Slot 3,Empty,ROM file,Floppy,CoCo SDC,Sound & Speech,Orchestra90,Audio expansions,RS232;", + "HAP1FC8,CCCROMBIN,Slot 3 ROM;", + "P1oKM,Slot 4,Empty,ROM file,Floppy,CoCo SDC,Sound & Speech,Orchestra90,Audio expansions,RS232;", + "HBP1FC9,CCCROMBIN,Slot 4 ROM;", + "P1-,ROM pool: 256K total;", + "P1-,Max ROM: 128K per slot;", + "HCP1-,ROM load error: size/full;", + "P2,Floppy Disks;", + "P2-,Media follows controller;", + "D3P2S2,DSK,Drive 0;", + "D3P2S3,DSK,Drive 1;", + "D3P2S4,DSK,Drive 2;", + "D3P2S5,DSK,Drive 3;", + "P3,CoCo SDC;", + "D1P3S0,DSKVHD,SDC Drive 0;", + "D1P3S1,DSKVHD,SDC Drive 1;", + "P3-,OS9 floppy mounts;", + "D1P3S2,DSK,OS9 Floppy /d0;", + "D1P3S3,DSK,OS9 Floppy /d1;", + "D1P3S4,DSK,OS9 Floppy /d3;", + "D1P3S5,DSK,OS9 Floppy /d4;", + "P4,Sound & Expansion;", + "DDP4oA,Expansion,Extended palette,Sound & Speech;", + "hDP4-,Assign SSC in Multi-Pak;", + "H5P4-,Sound & Speech not ready;", + "H6P4-,Sound & Speech ready;", + "H7P4-,Sound & Speech error;", + "HFP4-,Orchestra90 stereo enabled;", + "P4-,Audio = SSC + Orchestra90;", + "P5,Cassette;", + "P5F2,CAS,Load Cassette;", + "P5TF,Stop & Rewind;", + "P5OH,Monitor Tape Sound,No,Yes;", + "P5S6,CAS,Save Cassette;", + "P5OE,Transport,Playback / Rewind,Record;", + "P6,Machine;", + "P6OPR,Memory Size,512K,1M,2M,16M;", + "P6OO,Force Turbo,No,Yes;", + "P6o02,Turbo Speed,CoCo Ctrl,0.89 MHz,1.78 MHz,2.86 MHz,3.58 MHz,7.16 MHz,9.54 MHz;", + "P6o89,Auto Run,Off,DOS,AUTO.BAS;", + "P6RM,Cold Boot;", + "P6R0,Reset;", + "P7,Display;", + "P7O89,Aspect ratio,Original,Full Screen,Wide,[ARC1];", + "P7O35,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%,CRT 75%;", + "P7OL,CoCo3 LC,Yes,No-(SG6=Yes);", + "P7o56,Artifact Type,MESS,Simple,NONE;", + "P7OI,Artifact Color Set,0,1;", + "P8,Input;", + "P8ON,D-Pad Joystick emu,No,Yes;", + "P8O6,Swap Joysticks,Off,On;", + "P8OS,Mouse as right joystick,Off,On;", + "P9,Advanced;", + "P9F3,BIN,Load COCO Font;", + "P9OG,Swap MiSTer Uart,RS CART,Default;", + "P9OU,Swap Uart to IO,RS IO,MiSTer;", + "P9OT,Display Debug,Off,On;", + "P9RA,Easter Egg;", "J,Button1,Button2;", "jn,A,B;", - "v,51;", + "v,51;", "V,v",{`BUILD_DATE,"-",`BUILD_NUMBER} }; @@ -282,7 +294,7 @@ wire clk_sys; assign clk_sys=CLK_57; -wire pll_locked, pll2_locked; +wire pll2_locked; wire CLK_114, CLK_57, CLK_28, CLK_14; assign VGA_DISABLE = 1'b0; @@ -298,10 +310,37 @@ pll pll .locked(pll2_locked) ); +// Cartridge ROM validity is cleared only by loss of the actual core PLL lock. +// Release synchronously after two system-clock edges, independent of CoCo reset. +(* preserve, altera_attribute = "-name SYNCHRONIZER_IDENTIFICATION FORCED_IF_ASYNCHRONOUS" *) +reg [1:0] ssc_power_release = 2'b00; +always @(posedge clk_sys or negedge pll2_locked) + if(!pll2_locked) ssc_power_release <= 2'b00; + else ssc_power_release <= {ssc_power_release[0],1'b1}; +wire ssc_power_reset = !ssc_power_release[1]; + /////////////////////////////////////////////////// -wire [63:0] status; -wire [63:0] status_in = 63'd0; +wire [63:0] status_raw; +reg [63:0] status = 64'd0; +wire [63:0] status_accepted; +bh_mpi_config mpi_configuration(.clk(clk_sys),.reset(ssc_power_reset), + .requested(status_raw),.accepted(status_accepted), + .status_in(status_in),.status_set(status_set)); +always @(negedge clk_sys) status <= status_accepted; +wire [11:0] mpi_layout=status[54:43]; +wire [3:0] mpi_rom_fault; +wire mpi_rom_loading,mpi_rom_loaded; +wire [2:0] menu_rom_kind,menu_io_kind; +wire menu_ssc,menu_orchestra,menu_floppy,menu_sdc; +bh_mpi_router menu_devices(.layout(mpi_layout),.cts(status[13:12]),.scs(status[13:12]), + .rom_kind(menu_rom_kind),.io_kind(menu_io_kind),.floppy_io(),.sdc_io(),.rom_io(),.serial_io(), + .ssc_present(menu_ssc),.orchestra_present(menu_orchestra), + .floppy_present(menu_floppy),.sdc_present(menu_sdc)); +function rom_picker_hidden(input [2:0] kind); + begin rom_picker_hidden=!(kind==1||kind==5||kind==6);end +endfunction +wire [63:0] status_in; wire status_set; wire [1:0] buttons; @@ -335,11 +374,18 @@ hps_io #(.CONF_STR(CONF_STR),.PS2DIV(2400), .VDNUM(7), .BLKSZ(2)) hps_io .buttons(buttons), - .status(status), + .status(status_raw), .status_in(status_in), .status_set(status_set), - .status_menumask({ ~(mpi == 2'b11), ~(mpi == 2'b10),~(mpi == 2'b01), 1'b1}), + .status_menumask({!menu_orchestra,1'b0,!menu_ssc,!(|mpi_rom_fault), + rom_picker_hidden(mpi_layout[11:9]), + rom_picker_hidden(mpi_layout[8:6]), + rom_picker_hidden(mpi_layout[5:3]), + rom_picker_hidden(mpi_layout[2:0]), + !status[42]||!ssc_fault,!status[42]||!ssc_ready, + !status[42]||ssc_ready,1'b1, + !menu_floppy,1'b0,!menu_sdc,1'b1}), .forced_scandoubler(forced_scandoubler), .RTC(RTC), .gamma_bus(gamma_bus), @@ -411,11 +457,15 @@ wire [9:0] center_joystick_y2 = 8'd128 + joya2[15:8]; wire [9:0] center_joystick_x2 = 8'd128 + joya2[7:0]; wire vclk; -wire [31:0] coco_joy1 = status[6] ? joy2 : joy1; -wire [31:0] coco_joy2 = status[6] ? joy1 : joy2; +reg [31:0] coco_joy1 = 0; +always @(negedge clk_sys) coco_joy1 <= status[6] ? joy2 : joy1; +reg [31:0] coco_joy2 = 0; +always @(negedge clk_sys) coco_joy2 <= status[6] ? joy1 : joy2; -wire [15:0] coco_ajoy1 = status[6] ? {center_joystick_x2[7:0],center_joystick_y2[7:0]} : {center_joystick_x1[7:0],center_joystick_y1[7:0]}; -wire [15:0] coco_ajoy2 = status[6] ? {center_joystick_x1[7:0],center_joystick_y1[7:0]} : {center_joystick_x2[7:0],center_joystick_y2[7:0]}; +reg [15:0] coco_ajoy1 = 0; +always @(negedge clk_sys) coco_ajoy1 <= status[6] ? {center_joystick_x2[7:0],center_joystick_y2[7:0]} : {center_joystick_x1[7:0],center_joystick_y1[7:0]}; +reg [15:0] coco_ajoy2 = 0; +always @(negedge clk_sys) coco_ajoy2 <= status[6] ? {center_joystick_x1[7:0],center_joystick_y1[7:0]} : {center_joystick_x2[7:0],center_joystick_y2[7:0]}; @@ -478,6 +528,7 @@ EE_Cold_Bt COCO3_EE_Cold_Bt ( wire [15:0] audio_left; +wire ssc_ready,ssc_fault; assign AUDIO_L = { audio_left[15:14], audio_left[13] ^ (status[17] ? casdout : 1'b0),audio_left[12:0]}; //assign AUDIO_R = AUDIO_L; assign AUDIO_S = 0; @@ -507,8 +558,15 @@ coco3fpga coco3 ( .CLK_28(CLK_28), .CLK_14(CLK_14), + .SSC_POWER_RESET(ssc_power_reset), + .SSC_MODE(status[42]), + .MPI_LAYOUT(mpi_layout),.MPI_BOOT_LOADING(status[0]),.MPI_ROM_FAULT(mpi_rom_fault), + .MPI_ROM_LOADING(mpi_rom_loading),.MPI_ROM_LOADED(mpi_rom_loaded), + .SSC_READY(ssc_ready), + .SSC_FAULT(ssc_fault), + // Reset - .COCO_RESET_N((~reset & Programmed_RESET_N)), + .COCO_RESET_N((~reset & Programmed_RESET_N) && !mpi_rom_loading), .RED_O(r), .GREEN_O(g), @@ -577,7 +635,7 @@ coco3fpga coco3 ( .PROBE_O(probe_o), .PROBE_I(probe_i), .clk_Q_out(clk_Q_out), - .casdout( casdout), + .casdout( cassette_cpu_sample), .cas_relay(cas_relay), // SDRAM @@ -602,7 +660,7 @@ coco3fpga coco3 ( .RTC(RTC), - .AMW_Trigger(coldboot | mpi_reset | mem_reset), + .AMW_Trigger(coldboot | mpi_reset | mem_reset | mpi_rom_loaded), // .AMW_Trigger(coldboot), .AMW_ACK(AMW_ACK), @@ -623,7 +681,7 @@ coco3fpga coco3 ( .UART_DSR(UART_DSR) ); -assign status_set = 1'b0; +// status_set is driven by the versioned layout/status normalizer. //wire [5:0] cocosound; @@ -636,7 +694,7 @@ wire AMW_ACK; //wire cpu_speed = status[11]; -wire [1:0] mpi = status[13:12] + 1'b1; +wire [1:0] mpi = status[13:12]; //wire video=status[14]; wire CASS_REW_RECORD=status[14]; wire rs_swap=status[16]; @@ -652,16 +710,16 @@ wire SWAP_M_J = status[28]; wire display_debug = status[29]; wire UART_INPUT = status[30]; wire digitalJoy = status[23]; -reg [2:0] mpi_d = 2'b00; +reg [13:0] mpi_d=14'd0; reg first_mpi_chg = 1'b0; reg mpi_reset = 1'b0; always @ (negedge CLK_14) begin - mpi_d <= mpi; + mpi_d <= {mpi_layout,mpi}; mpi_reset <= 1'b0; - if (~(mpi == mpi_d)) + if (~({mpi_layout,mpi} == mpi_d)) if (~first_mpi_chg) first_mpi_chg <= 1'b1; else @@ -709,18 +767,30 @@ wire sdram_vid_ready; wire sdram_busy; +// Research: decoded request payload is captured before the fast controller. +wire [24:0] bridge_addr; +wire [7:0] bridge_din; +wire bridge_req, bridge_rnw, bridge_ack; +cpu_sdram_bridge cpu_memory_boundary ( + .clk(clk_sys), .fast_clk(CLK_114), .reset(reset), .cpu_addr(sdram_cpu_addr), + .cpu_din(sdram_cpu_din), .cpu_req(sdram_cpu_req), .cpu_rnw(sdram_cpu_rnw), + .memory_ack(bridge_ack), .cpu_ack(sdram_cpu_ack), + .memory_addr(bridge_addr), .memory_din(bridge_din), + .memory_req(bridge_req), .memory_rnw(bridge_rnw) +); + sdram_32r8w coco3_sdram ( .*, .init(reset), .clk(CLK_114), - .sdram_cpu_addr(sdram_cpu_addr[24:0]), + .sdram_cpu_addr(bridge_addr), // .sdram_ldout(sdram_ldout), .sdram_dout(sdram_dout), - .sdram_cpu_din(sdram_cpu_din), - .sdram_cpu_req(sdram_cpu_req), - .sdram_cpu_rnw(sdram_cpu_rnw), - .sdram_cpu_ack(sdram_cpu_ack), + .sdram_cpu_din(bridge_din), + .sdram_cpu_req(bridge_req), + .sdram_cpu_rnw(bridge_rnw), + .sdram_cpu_ack(bridge_ack), .sdram_cpu_ready(sdram_cpu_ready), .sdram_vid_addr(sdram_vid_addr[24:0]), @@ -733,6 +803,8 @@ sdram_32r8w coco3_sdram wire casdout; +reg cassette_cpu_sample = 1'b0; +always @(negedge clk_sys) cassette_cpu_sample <= casdout; wire cas_relay; wire load_tape = ioctl_index == 2; diff --git a/LICENSES/Coco3Plus-BSD-3-Clause.txt b/LICENSES/Coco3Plus-BSD-3-Clause.txt new file mode 100644 index 0000000..33a638c --- /dev/null +++ b/LICENSES/Coco3Plus-BSD-3-Clause.txt @@ -0,0 +1,28 @@ +BSD 3-Clause License + +Copyright (c) 2026 Brian K. Holman +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSES/GPL-2.0.txt b/LICENSES/GPL-2.0.txt new file mode 100644 index 0000000..623b625 --- /dev/null +++ b/LICENSES/GPL-2.0.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/LICENSES/GPL-3.0.txt b/LICENSES/GPL-3.0.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/LICENSES/GPL-3.0.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/LICENSING.md b/LICENSING.md new file mode 100644 index 0000000..302b7dc --- /dev/null +++ b/LICENSING.md @@ -0,0 +1,53 @@ +# Component licenses and distribution + +This is a mixed-license derivative. Original file notices remain authoritative; +this document does not relicense third-party code, ROMs or Intel/Altera IP. +New original Plus work and modifications are copyright (c) 2026 Brian K. Holman; +the precise scope is recorded in COPYRIGHT.md. Those original contributions are +available under LICENSES/Coco3Plus-BSD-3-Clause.txt, subject to the original +licenses of any combined or derived material. + +## Inherited and derived source + +| Component | Inspected source notice | +|---|---| +| Core/video and related Gary Becker material | BSD-style source and synthesized-form redistribution conditions, including notice/disclaimer retention and no endorsement. See individual headers. | +| MiSTer HPS interface, SDRAM controller and John Kent CPU variants | GPL version 3 or later in the applicable headers. SDRAM modifications also retain Stan Hodge/Sorgelig provenance. | +| Other MiSTer framework helpers | File-specific terms; some GPL version 2 or later. Keep each header, not a single inferred replacement license. | +| New SSC controller/speech/wiring derived from reference models | BSD-3-Clause; retain rtl/ssc/LICENSE and component attribution to Tim Lindner, Joseph Zbiciak and hap. | +| New MPI and original Plus helpers/tests/tooling | BSD-3-Clause for original contributions, with preserved reference-source terms where extracted code is involved. | +| Generated Intel/Altera IP and device primitives | Their original vendor notices/terms; a project-level BSD/GPL declaration does not replace these. | +| Greg Miller mc6809glb CPU | Original copyright-only header retained. No explicit upstream license grant found in that file. See assumption below. | + +For a combined distribution containing GPL-covered material, retain the applicable +GPL terms and provide the corresponding source, build scripts and notices as +required by those licenses. A bitstream-only release must not omit the source +and license obligations that apply to its components. See the original +[GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.html), +[GNU GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) and file headers. +This repository's permissive contribution license is not a blanket assertion +that the complete synthesized design is BSD-only. + +## Maintainer assumption: Greg Miller CPU + +The Coco 3 Plus FPGA Maintainer currently proceeds on the assumption that Greg +Miller's original CPU implementation is public domain. This is a **maintainer +assumption, not a confirmed upstream dedication or permission grant**. The +original copyright notice remains in rtl/mc6809glb/mc6809glb.v. If contrary or +clarifying information is received, amend this notice and distribution practice. +New Plus modifications are identified separately; this assumption does not +erase another author's rights or claim their work as original Plus code. + +## ROMs, software libraries and external tools + +SSC ROMs are external user-supplied inputs and are ignored by Git. The public +setup script does not fetch them. ToolShed cocoroms assembly is downloaded at a +pinned revision with original source notices retained; reproducible assembly is +not proof of blanket ROM redistribution permission. Included diagnostic/game +media require their own terms. Do not publish a library or a locally complete +release overlay merely because it was useful for private validation. + +LWTOOLS, OSS CAD Suite, Quartus and MiSTer Linux/Main/Mr. Fusion have separate +licenses. Downloading or invoking those tools does not transfer their copyright +to this project. A future standalone image must preserve its operating-system, +bootloader and image-builder notices/source obligations in addition to the core's. diff --git a/NOTICE.md b/NOTICE.md new file mode 100644 index 0000000..64730ab --- /dev/null +++ b/NOTICE.md @@ -0,0 +1,29 @@ +# Attribution + +Original Coco 3 Plus contributions and modifications: +**Copyright (c) 2026 Brian K. Holman.** See COPYRIGHT.md and LICENSING.md. + +This project derives from MiSTer-devel/CoCo3_MiSTer, the MiSTer port of Gary +Becker's CoCo3FPGA by Stan Hodge, Gary Becker and Alan Steremberg. Original +histories and source notices are retained. CPU implementations credit Greg +Miller and John E. Kent in their respective source files. MiSTer framework work +retains attribution including Alexey Melnikov (Sorgelig), Till Harbaum and other +file-specific contributors. + +The inherited extended-color/video implementation is credited to its existing +CoCo3FPGA/MiSTer authors and headers; no new invention claim is made for that +feature. The source also credits Brandan Donahe for the MESS artifact function. +Plus adds selectable ownership and integration while preserving the inherited +extended-palette logic. + +SSC chip/wiring work uses the public algorithms and source models credited to +Tim Lindner, Joseph Zbiciak and hap through MAME and VCC Plus references. See +rtl/ssc/LICENSE and source headers. This is source-informed implementation, +not a claim of clean-room independence. Original firmware remains separately +supplied and owned by its respective rights holders. + +ToolShed supplies the pinned CoCo ROM assembly recipe/sources. LWTOOLS supplies +the native 6809 assembler. MiSTer Main supplies the unmodified host environment +and the original parser functions used in isolated validation fixtures. No +affiliation or endorsement by these projects or original hardware vendors is +implied. diff --git a/README.md b/README.md index fb978ed..0ff28d1 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,53 @@ -# CoCo3 Mister +# Coco 3 Plus for MiSTer +Coco 3 Plus extends [CoCo3_MiSTer](https://github.com/MiSTer-devel/CoCo3_MiSTer) +with a configurable four-slot Multi-Pak, an original-firmware Sound & Speech +implementation, a reorganized menu, and clock/reset/memory timing repairs. +The original upstream Git history is retained; the Plus implementation is one +consolidated commit on `main`. Other original branches and tags remain available. -## CoCo3FPGA port to MiSTer +The Computer menu entry is **Coco 3 Plus**. Media lives in +`/media/fat/games/coco3plus`, independently of the stock CoCo3 core. +This targets a DE10-Nano MiSTer with the upstream-required **128 MB SDRAM module**. +The separate original DE1 port is outside this repository. -This is a port of Gary Becker's famous CoCo3 in an FPGA to the MiSTer platform by Stan Hodge, Gary Becker and Alan Steremberg. +## Build and install on Windows -## Roms Needed +Install Git, Python 3.10+, and Quartus Prime Lite **17.0.2 Build 602** with +Cyclone V device support. From this checkout in PowerShell: -* boot0.rom - 32K coco3 rom -* boot1.rom - 8K Disk extended color basic rom +```powershell +.\windows\Setup-Tools.ps1 +.\windows\Build-ROMs.ps1 +.\windows\Build-FPGA.ps1 -QuartusSh C:\intelFPGA_lite\17.0\quartus\bin64\quartus_sh.exe +# Place your separately obtained SSC ROMs in roms\ssc first. +.\windows\Install-MiSTer.ps1 -Load +``` -Note: This core requires the external sdram memory module (128M) to function. +The installer prompts for an IP address or hostname and uses your existing +passwordless SSH access. It preserves the stock core, existing games and saved +Plus configuration, and backs up replaced files. Save/quit the running guest +before installation: installation returns to the MiSTer menu. -Rename your roms, and place them in the games/CoCo3/ directory -otherwise you will get a black screen +The ROM build downloads pinned ToolShed assembly and uses native Windows LWASM; +it does not depend on another emulator checkout, Bash, WSL or CMOC. SSC's two chip +ROMs are separate inputs, ignored by Git and never downloaded by setup. +- [Windows toolchain and reproducible builds](docs/BUILD_WINDOWS.md) +- [Install, copy release files, first boot and rollback](docs/INSTALL.md) +- [Features and hardware behavior](docs/FEATURES.md) +- [Complete menu tree and operating notes](docs/MENUS.md) +- [Bug fixes: causes, implementation and checks](docs/BUG_FIXES.md) +- [Validation results and explicit limits](docs/VALIDATION.md) +- [Licenses and component provenance](LICENSING.md), [attribution](NOTICE.md) +- [Required ROM inputs](roms/README.md) +- [Standalone SD-image direction](docs/SD_IMAGE.md) +`Package-Release.ps1` produces a checked FAT-volume overlay for copying onto an +existing MiSTer card. The same payload is the basis for a future dedicated boot +image. An overlay alone is not a bootable image; MiSTer Linux and bootloader files +also reside on the SD card. +Timing results apply to the documented SDRAM/board-delay profile. Passing +simulation and static timing does not establish electrical compatibility with +every SDRAM module or validate every optional physical interface. diff --git a/docs/BUG_FIXES.md b/docs/BUG_FIXES.md new file mode 100644 index 0000000..3d170e1 --- /dev/null +++ b/docs/BUG_FIXES.md @@ -0,0 +1,98 @@ +# Fixes and engineering changes + +This inventory describes the delta from upstream commit +`8b8cf72d1fb4de1d05345de8d5b92ec2d500fcd2`. It distinguishes repairs to inherited +logic from new features and defects found while integrating those features. +The checks below establish their stated scopes; they do not turn source +inspection into a claim of a reproduced field failure. + +## Inherited clock, reset and memory paths + +| Area and problem | Change and relevant source | Verification and limits | +|---|---|---| +| FDC/SDC mount metadata used transfer events as clocks, leaving generated-clock and phase hazards. | Capture mount strobes/metadata synchronously, classify on a subsequent phase and present stable consumer inputs. `rtl/fdc.sv`, `rtl/sdc_top.sv`, `rtl/sdc.sv`, top-level bindings. | Interface/phase simulations and fitted setup/hold. A mounted DSK still needs guest-format compatibility checks. | +| UART timing used independently derived fabric clocks and incompletely coordinated resets. | Use source-clock enables and explicit global/software reset release; preserve UART bit rate and register behavior. `rtl/UART_6551/` and core serial bindings. | Serial/reset component regressions and UART fitted paths. Physical RS232/GPIO electrical routing is separate. | +| NMI pending/mask state used a generated sampling clock and asynchronous clear path. | Move pending sampling/clear into the master domain, preserve sample ordering and mask/shadow priority, clear pending state on warm reset. `rtl/mc6809glb/mc6809glb.v`. | CPU/NMI regressions and both-corner NMI paths. The S-register change heuristic is retained; this is not a claim of a new fully cycle-exact 6809. | +| Reset sequencing was timed through a signal treated as a clock, with high-fanout cross-phase release. | Separate reset requests from synchronized consumer releases at the 57/114 MHz and opposite-edge boundaries; preserve original startup counters and peripheral-before-CPU order. `rtl/coco3fpga.sv`, disk wrappers and SDC/WD logic. | Extracted actual reset chains, complete reset timing scopes, negative control for unsupported consecutive enables. No blanket false-path waiver replaces release timing. | +| CPU-to-SDRAM requests/completions crossed phase boundaries without explicit registered contracts. | Add `rtl/cpu_sdram_bridge.sv`; register request, address/data/control and completion observation in their proper phases. Preserve the proven nonconsecutive CPU-enable contract. | Protocol, actual-controller, boot-control and delayed-data benches; fitted bridge/control/CPU checks. Simulation adaptations preserve logic but do not model physical SDRAM pins. | +| Keyboard/control and CPU-visible peripheral values could be observed on the wrong consumer phase. | Capture keyboard flags and control/request boundaries, align data-ready observation and SDC CPU buffer access with actual inverted wrapper clocks. Keep the original WD direct read path. | Exhaustive keyboard decode/phase comparison, peripheral and disk-buffer tests with the real wrapper inversion. A passing leaf-only RAM test was insufficient and was replaced. | +| Video address arithmetic extended into the SDRAM ACTIVE decision, creating an inherited negative setup path. | Snapshot the video address before ACTIVE; retain the existing two-word read burst and wrap/guard semantics. `rtl/sdram/sdram2.sv`. | Original-versus-candidate fetch comparison and corrupted-address negative control, plus fitted snapshot/activation paths. No video-address false path is added. | +| SDRAM startup/refresh/return behavior lacked an explicit external timing contract. | Match refresh cadence, startup/precharge recovery and return capture to the documented controller/device profile; phase the forwarded clock through the configured DDIO path. | Command scheduler, delayed CPU/video data models and pin-level STA for the conditional Alliance -7 profile. Unknown module speed/PCB delay remains an assumption. | +| Pixel, audio and board-I2C boundaries were incompletely modeled in STA. | Add source-matched pixel/forwarded clocks and external input/output budgets; constrain both HDMI video clock modes, audio transport and MCP I2C. Preserve bounded I2C protocol timing. `external-io.sdc`, `CoCo3.sdc`, framework audio/I2C bindings. | Actual divider/duty negative control, audio serialization, delayed I2C and 48 substantive external scopes. Optional HPS/muxed/async pins are classified separately, not silently declared timed. | + +CPU multicycle constraints are restricted to source-qualified register roles and +proven enables. Unqualified state remains single-cycle. Reset and SDRAM fixes +retain explicit phase/latency contracts; adding an extra return cycle merely to +improve fit is not acceptable. + +## New SSC implementation and integration corrections + +These are new hardware functions, not fixes to a pre-existing upstream SSC core. +`rtl/ssc/` implements the host bridge, cartridge glue, TMS7000-family controller, +AY-3-8913 and SP0256 speech path. `rtl/coco3fpga.sv` supplies CPU decode/audio; +`CoCo3.sv` supplies menu/runtime ROM input and actual-PLL reset wiring. + +- **Runtime ROM lifetime:** guest reset originally risked clearing loaded ROM + validity. Tie cartridge power reset to the actual core PLL-lock release chain, + preserving valid firmware across guest reset/cold boot. Both original ROMs must + pass the strict complete-load contract before ready is asserted. +- **Shared-address ownership:** SSC must replace the inherited video-extension + register decode when selected. Gate both sides, qualify reads before the + ordinary bus mux, and disable SSC selection when no capable socket exists. +- **Command/CPU phase ordering:** latch host transactions and firmware-visible + transitions on explicit enables; preserve data/status ordering and reset/abort + recovery. Never interpret idle FF as a missing cartridge. +- **Original firmware execution:** instruction, immediate-operand, flag, stack, + timer/interrupt and peripheral semantics follow the actual firmware and chip + documentation/reference models. In particular FF operand handling is exercised + by dedicated regressions. The implementation runs the original bytes rather + than substituting host-side command responses. +- **Speech and audio completion:** integrate sequencer/ROM/LPC filtering and AY + tone/noise/envelope output into the legacy audio mix. Busy/readiness must return + to idle after normal completion or deliberate abort/reset. Mono SSC does not + replace Orchestra90's stereo route. + +Original-firmware integration, chip/component fixtures, fitted live-chip path +audits and Sound Lab listening/transaction checks provide complementary evidence. +Human listening confirms audibility; it is not an automated waveform-equivalence +claim for all possible cartridge commands. + +## Four-slot integration corrections + +| Defect found during development | Final behavior and check | +|---|---| +| HPS decode/RAM allocation on opposing edges left an inadequate transfer path. | Register incoming transfer metadata/data before allocation/writes. Pool tests and fitted MPI paths check the full stage. | +| Removal/failure overlap could retain allocation or active autoload state. | Removed sockets free blocks; failed/new downloads cannot corrupt neighboring allocations. Concurrent removal/failure regression checks this explicitly. | +| Duplicate built-in assignment could create ambiguous routing. | Most recently edited socket wins; singleton devices move. Combined Audio can leave its other component in the old socket. Exhaustive router/config fixtures exercise deterministic normalization. | +| Main sends remembered files before restoring saved layout. | Stage early slot ROMs while Main holds reset, then accept against restored layout. Testing only a default layout missed the Slot4 case; native parser and composed startup fixtures now include non-default layouts. | +| Normalization acknowledgement could clear Main's initialization reset too early. | Defer publishing migration status until Main's final release. Staging files alone did not fix this second initialization ordering issue. The old behavior is a negative-control failure. | +| Long labels truncated the usable OSD rows. | Use short labels within the existing OSD width, retain nine stable pages and explicitly show pool limits, assignment requirements and readiness. Native Main menu parser checks every option's status-bit contract and conditional row visibility. | + +The new router keeps CTS/SCS independent and qualifies read/IRQ/bank behavior +against the effective socket. Tests extract the actual top/core bindings rather +than checking only an isolated idealized router. Native menu/startup tests use +pinned original Main functions; no custom Main binary is required. + +## Packaging and startup corrections + +The launcher and embedded display identity are Coco 3 Plus; native MGL `setname` makes settings/media +use `coco3plus` consistently. Hidden RBF storage keeps the stock core separate. +Remembered-file records must use the canonical folder and accept the existing +absolute/relative Main path conventions. Old-prefix replacements must respect +folder boundaries, not accidentally rewrite a similarly named folder. + +The installer passes raw structured SCP arguments. Embedding shell quote marks +inside a modern SFTP path can create literal quotes or fail a spaced launcher +upload; shell quoting is reserved for the remote shell script itself. It stages +and checks files before activation, preserves saved settings, and records rollback. +These are deployment fixes, not defects attributed to upstream FPGA/Main logic. + +## Corrections that were test issues, not core bugs + +Idle SSC status FF is expected. Disk BASIC direct-mode `INPUT#` raises ID +(illegal direct); stored-program reads succeed. A panic attempted after speech +already completed cannot prove active abort recovery. Mouse JOYSTK queries must +use the configured port and a progressing BASIC loop. These observations led to +corrected tests, not speculative RTL edits. An intermediate SDRAM candidate with +an unnecessary extra READY/return stage produced a green-@ startup failure; it +was rejected and the first-beat contract restored before qualification. diff --git a/docs/BUILD_WINDOWS.md b/docs/BUILD_WINDOWS.md new file mode 100644 index 0000000..c485d86 --- /dev/null +++ b/docs/BUILD_WINDOWS.md @@ -0,0 +1,129 @@ +# Windows build and validation + +## Required tools + +Use 64-bit Windows, Git for Windows and Python **3.10 or newer**. Scripts use the +Python standard library. PowerShell wrappers accept `-Python ` when +`python` is not on PATH. All commands below run from the repository root. + +Install **Quartus Prime Lite 17.0.2, Build 602**, including Cyclone V device files. +The device is **5CSEBA6U23I7**. The project originated in Quartus 17.0; its pinned +settings record 17.0.2. Install the 17.0 base package and matching device package, +then the 17.0 Update 2 package when using the separate installers. Check: + +```powershell +& C:\intelFPGA_lite\17.0\quartus\bin64\quartus_sh.exe --version +``` + +Obtain installers through the [official Altera software download center](https://www.altera.com/downloads). +See also [MiSTer's compilation guidance](https://mister-devel.github.io/MkDocs_MiSTer/developer/compile/). +Setup does not silently install Quartus, accept its license or select a newer IP +generator. Other Quartus versions require separate baseline/timing validation. + +## Download public build dependencies + +```powershell +.\windows\Setup-Tools.ps1 +``` + +This downloads native Windows x64 [LWTOOLS 4.25](https://www.lwtools.ca/releases/lwtools/), +eight pinned [ToolShed cocoroms](https://github.com/nitros9project/toolshed/tree/3667a41c9605b7fcb150eace29cc7f42d460be1a/cocoroms) +source files and four pinned MiSTer Main source files used only by parser tests. +Archives, extracted files and individual source files are checked against +`tools/toolchain.json` and `tools/cocoroms.json`. Existing changed downloads are +rejected, not silently replaced. `.cache`, `.tools` and `.deps` are ignored. +No SSC firmware, software library or emulator source is fetched. + +## Assemble boot ROMs + +```powershell +.\windows\Build-ROMs.ps1 +``` + +The native LWASM recipe follows ToolShed's dependency order: BASIC 1.3, +`dumpcb_equates`, Extended BASIC 1.1, `dumpecb_equates`, Disk BASIC 1.1 with +`noindex0tonone`, then the CoCo3 ROM. Four output SHA-256 values must match before +`boot0.rom` and `boot1.rom` are staged in `build/roms`. The receipt records every +command and input/output identity. No C compiler or CMOC is required. + +The assembly rebuild is reproducible; availability of source is not a blanket +permission to redistribute the resulting third-party ROMs. See LICENSING.md. +The ToolShed tree inspected contains SSC documentation but no original SSC +TMS7040 or SP0256 ROM source. Those chips cannot be reconstructed with this +6809 assembly recipe; supply their verified originals as described in roms/README.md. + +## Compile the FPGA + +```powershell +.\windows\Build-FPGA.ps1 -QuartusSh C:\intelFPGA_lite\17.0\quartus\bin64\quartus_sh.exe +``` + +This makes a fresh `build/fpga/project` copy, records individual source hashes, +uses the committed seed 5 and original build-ID flow, and invokes the native +Quartus compile. It leaves checked-in source/IP untouched. Logs, reports, bitstream +and `build.json` remain under `build/fpga`. Success requires a generated RBF, +nonnegative timing-summary slack and unchanged input hashes. Warning details +remain in the native log; success is not a claim that no warnings occurred. + +Never compile in the source checkout or let the GUI replace HDL assignments. +New HDL belongs in `files.qip`; add it and any new source/IP/data dependencies to +the maintained `tools/project_inputs.json` inventory too. The builder rejects +unlisted HDL/constraint/IP inputs in the source directories before copying. +`validation/source-import.json` is historical provenance, not the build inventory. +The receipt derives the seed from the actual single QSF assignment. +Generated caches/IP upgrades stay in build copies. +Outputs are preserved: use `-Output build/fpga-next` for another build, with matching +`--build` arguments when packaging/auditing it, rather than deleting prior results. + +## Functional and detailed timing checks + +Optional HDL tooling can be downloaded with: + +```powershell +.\windows\Setup-Tools.ps1 -IncludeSimulator +.\windows\Test.ps1 +``` + +The pinned OSS CAD Suite supplies Icarus Verilog. The native Main parser fixtures +also need Visual Studio 2022 C++ Build Tools (MSVC and Windows SDK), or a native +C++17 compiler on macOS/Linux. These fixtures compile selected original parser +functions with mocked file/transport calls; they do not build or replace Main. +Supply an existing suite with `Test.ps1 -Suite `. + +`scripts/run_regressions.py` runs 15 independent jobs: MPI modules and actual core +bindings, original-firmware SSC integration, memory/reset/keyboard/peripheral +phase checks, SDRAM command/delayed-data tests, audio/pixel/I2C contracts, native +startup/menu parsing and original-versus-new video fetch. Several include +deliberately faulty negative controls. Complete repeat runs require a new +`--output build/` directory. SSC integration requires the ignored chip ROMs. + +After a full fit, run detailed path audits with: + +```powershell +python tools/audit_timing.py --quartus C:\intelFPGA_lite\17.0\quartus\bin64\quartus_sta.exe +``` + +The audits inspect the fitted MPI, CPU/reset, NMI, UART, video, SSC and conditional +external-I/O profile at both timing corners. Empty reports are never treated as +substantive passes; synchronous-only recovery/removal reports may be empty where +explicitly documented. These checks do not remove the remaining physical-board +assumptions listed in docs/VALIDATION.md. + +## Release/install + +```powershell +.\windows\Package-Release.ps1 +.\windows\Install-MiSTer.ps1 -Release dist\coco3plus -Load +``` + +Packaging verifies the RBF and boot/SSC ROM identities, writes a manifest and +SHA256SUMS, and creates a copyable `fat/` overlay. No files from build caches or +source-reference downloads are installed. Packaging requires reviewed changes +committed; corresponding source comes only from that committed Git tree, never +untracked local files. `-PublicPackage` omits all separately obtained/assembled ROMs +and produces a core/source distribution requiring user ROM preparation. It is +distinct from a complete local install package. Details: docs/INSTALL.md. + +Portable Python entry points under tools/ support native macOS/Linux tooling +where available. Quartus itself has no native macOS build; use the Windows or +supported Linux toolchain. The automatic prebuilt-tool download is Windows x64. diff --git a/docs/FEATURES.md b/docs/FEATURES.md new file mode 100644 index 0000000..63c6160 --- /dev/null +++ b/docs/FEATURES.md @@ -0,0 +1,83 @@ +# Features and implementation + +## Four independently configured sockets + +The new Multi-Pak configuration separates **what is installed**, **which socket +starts selected**, and **which media is mounted**. Each of four sockets can hold +Empty, ROM file, Floppy, CoCo SDC, Sound & Speech, Orchestra90, Audio expansions, +or RS232. Built-in controllers are singletons: assigning one elsewhere moves +that device rather than inventing another independent controller. The combined +Audio expansions entry preserves simultaneous legacy Orchestra90 and selectable +SSC behavior; it is a convenience combination, not an original physical cartridge. + +The router follows independent guest CTS and SCS selectors, with device-qualified +read data, writes and interrupts. Four ROM sockets share a 256 KiB allocation +pool; a single image can use at most 128 KiB. Socket state and banking are private +to each socket. Removing a ROM frees its allocation and suppresses stale autoload. +An oversized/full-pool transfer reports a load error rather than overwriting a +neighbor. Floppy/SDC mounted images follow their controller when it moves slots. +Device changes deliberately cold-restart the guest; media selection does not. + +Persisted legacy settings are migrated into a marked four-slot layout. MiSTer +Main's original remembered-file mechanism loads cartridge and SSC files without +custom host software. Early file transfers are staged while initialization holds +reset, then matched against the restored layout before the guest is released. + +## Original-firmware Sound & Speech + +The SSC implementation includes a TMS7000-family instruction/peripheral engine +for the cartridge's TMS7040 controller, the original 4 KiB controller firmware, +an AY-3-8913-compatible tone/noise/envelope path, an SP0256-compatible speech +sequencer/LPC path using the original 2 KiB AL2 ROM, host interface and cartridge +glue. The original ROM bytes are runtime inputs, not re-created firmware or an +emulator audio recording. Chip implementations are synchronous FPGA logic. + +Host status/data behavior, firmware command handshakes, reset/ready transitions, +busy/abort/recovery, firmware instruction behavior and generated samples are +covered by component/integration testing and shared Sound Lab diagnostics. +Normal idle status is FF; it is not evidence of an absent card. No unsupported +cartridge IRQ is invented. Original SSC is mono; its signal is mixed into both +outputs alongside the legacy CoCo audio path. Orchestra90 remains stereo and +can coexist through Audio expansions or distinct assigned sockets. + +SSC ROM validity belongs to FPGA power/configuration lifetime. A guest cold boot +or reset does not discard valid runtime ROMs; real core PLL-lock loss does. Strict +file length/address/loader completion checks prevent a partial load from being +reported ready. The OSD shows not ready, ready or error separately. + +## SSC and extended-color register ownership + +The inherited FPGA extended-color/video-DAC feature uses an address also occupied +by SSC cartridge registers. **Sound & Expansion → Expansion** selects Extended +palette or Sound & Speech. Only the selected implementation owns the shared +register decode. SSC mode also requires an SSC-capable socket assignment; the +menu disables the option and explains the missing assignment otherwise. + +The extended palette is an FPGA-specific enhancement, not a claim that an +unmodified physical CoCo3 had that feature. Its original palette/video behavior +is preserved. Orchestra90 does not require enabling the extended-color mode. +Do not infer SSC presence merely from a loaded ROM filename; socket and expansion +ownership determine whether the guest can address it. + +The inherited graphics extension provides 256 palette entries with 12-bit RGB +values (four bits per channel) and extended graphics decode. Its VDAC programming +write at FF7E conflicts with SSC; its color lookup and supported pixel-latch +geometry follow `rtl/VDAC.v`, `rtl/VDAC.mif` and `rtl/Mister_Video.v`. This is +preserved implementation, including source-specific low-resolution latch behavior, +not a newly invented standard display mode. Use the original source/manual for +register programming rather than assuming every extended mode is byte-per-pixel. + +## Existing functions retained + +- Four WD1793-style floppy image mounts and Disk BASIC. +- Two SDC image mounts accepting DSK/VHD plus the existing OS9 floppy mount rows. +- ROM/cartridge loading and banked access within the documented memory pool. +- Cassette CAS playback, rewind, monitoring and recording/export path. +- 512K/1M/2M/16M guest memory choices and existing turbo/autorun controls. +- Aspect ratios, scandoubler effects, artifact choices and CoCo3 LC option. +- USB joystick emulation, swap and mouse as right joystick. +- RS232/UART routing, font loading and debug/Easter Egg controls. + +Retained source functionality is not a claim that every optional peripheral, +physical I/O route or large disk format has been tested on the development unit. +See VALIDATION.md for observed coverage and remaining work. diff --git a/docs/INSTALL.md b/docs/INSTALL.md new file mode 100644 index 0000000..0382aac --- /dev/null +++ b/docs/INSTALL.md @@ -0,0 +1,105 @@ +# Install and operate Coco 3 Plus + +## Existing MiSTer, passwordless SSH + +Have a working MiSTer installation and key-based SSH login before running the +installer. On Windows OpenSSH is available as an optional Windows feature. Test: + +```powershell +ssh root@YOUR-MISTER +``` + +Establish the correct host fingerprint and public-key login through your normal +SSH setup. The installer uses `BatchMode=yes` and `StrictHostKeyChecking=yes`: +it does not request/store passwords or accept unknown host keys silently. +The default Unix user is root, as on standard MiSTer. Another account must already +have permission to write the FAT volume and issue MiSTer commands. + +Build ROMs/FPGA per BUILD_WINDOWS.md. Put the two separately obtained chip ROMs +in `roms/ssc`; packaging checks their exact size and SHA-256 before remote writes. +They remain ignored by Git. Then save guest work, close files and stop disk +activity. Installation returns to MENU, so the current guest session is ended. + +```powershell +.\windows\Install-MiSTer.ps1 -Load +# Or specify the address: +.\windows\Install-MiSTer.ps1 -HostName YOUR-MISTER -Load +``` + +If no address is given, the script prompts for one. It first validates every +local input, then checks remote access, stages files, verifies remote SHA-256, +returns to MENU, backs up replaced files, copies the overlay, checks installed +hashes, syncs the volume and optionally loads the launcher. A timestamped receipt +in ignored dist storage records the device and rollback path. It does not change +accounts, networking, Samba, the Linux installation or nonvolatile FPGA storage. + +Only the Plus launcher, its uniquely addressed RBF, two boot ROMs and optional +SSC ROM/path records are installed. The stock core and other guest media remain. +Existing `coco3plus_v51.CFG` is kept. First installs get Audio expansions / SDC / +ROM / Floppy, startup Slot4, 512K, and Sound & Speech enabled when ROMs are supplied. +Existing users retain their own layout and expansion selection. + +`-WithoutSSC` creates a base-only package without chip ROMs/path records. It does +not delete SSC files already installed on a device. Its +fresh configuration selects Extended palette. SSC remains unavailable until +valid ROMs are supplied and its cartridge/mode is selected. + +## Files and copying instead of SSH + +`Package-Release.ps1` writes `dist/coco3plus/fat` and the matching +`dist/coco3plus.zip` archive. The release also includes a corresponding-source +ZIP, file checksums, notices and manifest. The FAT overlay contains: + +```text +fat/ + _Computer/Coco 3 Plus.mgl + _Computer/.coco3plus//coco3plus.rbf + games/coco3plus/boot0.rom + games/coco3plus/boot1.rom + games/coco3plus/pic-7040-510.bin (separate supplied input) + games/coco3plus/sp0256-al2.bin (separate supplied input) + config/coco3plus.f4, coco3plus.f5 (when SSC included) + config/coco3plus_v51.CFG (new installs only) +``` + +Power off MiSTer before removing its card. Copy the **contents** of fat/ to its +data-volume root, including `_Computer`'s hidden `.coco3plus` child. Back up collisions +and skip the supplied CFG when one already exists. Preserve the manifest next +to your release archive. Copying this folder onto an unprepared card does not +install Linux or make it bootable. + +Guest `.DSK`, `.VHD`, `.CCC`, `.ROM`, `.BIN` and `.CAS` files belong in +`games/coco3plus` or subfolders. A software library is optional and is not silently +downloaded or redistributed by setup. Keep a pristine diagnostic disk and use +writable copies for saved results. + +## Public source/core packages + +Local complete packages can contain your own ROM inputs and must not be published +as though ignored files were automatically excluded from ZIPs. Use +`Package-Release.ps1 -PublicPackage -Output dist/coco3plus-public` for a source/core +artifact that omits all boot and SSC ROMs. Supply the required ROMs before manual +copy/launch. The SSH installer rejects this incomplete-ROM package and directs +you to make a complete local package from your own verified inputs. + +## First launch and recovery + +Choose Computer → Coco 3 Plus. It should reach Disk Extended Color BASIC. +`PRINT 1+1` should print 2. F12 → Sound & Expansion reports Sound & Speech ready +after its original ROMs load automatically. F12 → Cartridges & Multi-Pak controls +the four sockets and startup slot. F12 → Floppy Disks mounts images without +changing the layout. Changing socket devices restarts the guest. + +The MGL uses native `setname=coco3plus`, so settings and remembered files use the +same canonical namespace. The RBF also identifies itself as **Coco 3 Plus**, so +welcome/help strings no longer expose the retired development name. The native +profile override remains `coco3plus`; changing the display identity does not +require abandoning the existing saved settings or media. + +For rollback, return to MENU and restore `_Computer/Coco 3 Plus.mgl` from the +receipt's remote backup directory. Its previously addressed RBF remains in place. +Restore backed-up boot/SSC/path files if those inputs also need rollback. Existing +saved CFG was not overwritten. On a first installation, select the preserved +stock CoCo3 entry to use the original environment. Keep backup/staging folders +until physical cold-start and audio checks pass; failed installs retain their +staging evidence instead of deleting it automatically. diff --git a/docs/MENUS.md b/docs/MENUS.md new file mode 100644 index 0000000..639706f --- /dev/null +++ b/docs/MENUS.md @@ -0,0 +1,105 @@ +# Menu tree and operating guide + +Select **Computer → Coco 3 Plus**, then press F12 for its core menu. Escape/F12 +closes the OSD; Left returns from a page. MiSTer's own system menu supplies core +selection, configuration saving and other host-wide controls. The following tree +is the Plus `CONF_STR` organization; conditional rows depend on assigned devices. + +```text +Coco 3 Plus +├─ Cartridges & Multi-Pak +│ ├─ Startup slot: Slot 1 / Slot 2 / Slot 3 / Slot 4 +│ ├─ Slot 1: Empty / ROM file / Floppy / CoCo SDC / Sound & Speech / +│ │ Orchestra90 / Audio expansions / RS232 +│ │ └─ Slot 1 ROM (when that socket provides program ROM) +│ ├─ Slot 2: same device choices; Slot 2 ROM +│ ├─ Slot 3: same device choices; Slot 3 ROM +│ ├─ Slot 4: same device choices; Slot 4 ROM +│ ├─ ROM pool: 256K total; Max ROM: 128K per slot +│ └─ ROM load error: size/full (only on error) +├─ Floppy Disks +│ ├─ Drive 0: DSK +│ ├─ Drive 1: DSK +│ ├─ Drive 2: DSK +│ └─ Drive 3: DSK +├─ CoCo SDC +│ ├─ SDC Drive 0: DSK / VHD +│ ├─ SDC Drive 1: DSK / VHD +│ └─ OS9 floppy mounts: /d0 / /d1 / /d3 / /d4 (DSK) +├─ Sound & Expansion +│ ├─ Expansion: Extended palette / Sound & Speech +│ ├─ Assign SSC in Multi-Pak (when no SSC-capable socket exists) +│ ├─ Sound & Speech not ready / ready / error +│ ├─ Orchestra90 stereo enabled (when assigned) +│ └─ Audio = SSC + Orchestra90 (explanation) +├─ Cassette +│ ├─ Load Cassette: CAS +│ ├─ Stop & Rewind +│ ├─ Monitor Tape Sound: No / Yes +│ ├─ Save Cassette: CAS +│ └─ Transport: Playback / Rewind / Record +├─ Machine +│ ├─ Memory Size: 512K / 1M / 2M / 16M +│ ├─ Force Turbo: No / Yes +│ ├─ Turbo Speed: CoCo Ctrl / 0.89 / 1.78 / 2.86 / 3.58 / 7.16 / 9.54 MHz +│ ├─ Auto Run: Off / DOS / AUTO.BAS +│ ├─ Cold Boot +│ └─ Reset +├─ Display +│ ├─ Aspect ratio: Original / Full Screen / Wide / [ARC1] +│ ├─ Scandoubler Fx: None / HQ2x / CRT 25% / CRT 50% / CRT 75% +│ ├─ CoCo3 LC: Yes / No-(SG6=Yes) +│ ├─ Artifact Type: MESS / Simple / NONE +│ └─ Artifact Color Set: 0 / 1 +├─ Input +│ ├─ D-Pad Joystick emu: No / Yes +│ ├─ Swap Joysticks: Off / On +│ └─ Mouse as right joystick: Off / On +└─ Advanced + ├─ Load COCO Font: BIN + ├─ Swap MiSTer Uart: RS CART / Default + ├─ Swap Uart to IO: RS IO / MiSTer + ├─ Display Debug: Off / On + └─ Easter Egg +``` + +The root has nine stable pages. Hidden legacy cartridge and SSC firmware loaders +remain in the configuration string for native startup-file compatibility. They +are not additional top-level pages or everyday user setup steps. + +## Choosing devices and disks + +Built-in devices move sockets. Selecting a second Floppy, for example, moves the +existing controller and its mounted disks to the newly chosen socket. Assigning +Sound & Speech or Orchestra90 separately can split the corresponding portion out +of Audio expansions. Other instances are cleared deterministically, preserving +one instance of each real built-in controller. ROM files may occupy multiple +sockets simultaneously within the shared allocation limit. + +Startup slot chooses the socket selected when the guest starts; it does not +rotate disk-controller types or change which disk image is mounted. The guest +can subsequently change its Multi-Pak selectors. Use Floppy Disks or CoCo SDC to +mount media for that controller. The rows are disabled when the corresponding +controller is absent. The OS9 mount names intentionally retain the upstream +/d0, /d1, /d3, /d4 conventions; they are not renumbered to imply new drive logic. + +Changing a socket device restarts the CoCo. Mount media and save your MiSTer core +configuration after arranging the machine. On the next launch, remembered ROMs +are restored with the saved layout; no manual SSC chip-ROM loading is needed. +The installer preserves an existing Plus CFG rather than imposing a new layout. + +## Sound and display + +Assign an SSC-capable socket, select Sound & Speech on the expansion page and +check ready before running cartridge software. Extended palette and SSC share +register space, so this is an ownership selection. Audio expansions is a +compatibility convenience for SSC plus Orchestra90, not a third sound chip. +MiSTer supplies audio through its supported HDMI/analog configuration; a remote +video capture device may omit or mute HDMI audio even when core output works. + +## Returning to MiSTer + +Use MiSTer's OSD system/core-selection controls to choose another core without +a physical power switch. Save guest files first. Guest Reset/Cold Boot operate +on the CoCo environment; they are different from loading another RBF or turning +the whole MiSTer off. diff --git a/docs/SD_IMAGE.md b/docs/SD_IMAGE.md new file mode 100644 index 0000000..9d11d62 --- /dev/null +++ b/docs/SD_IMAGE.md @@ -0,0 +1,37 @@ +# Two delivery forms, one core payload + +The release design has two delivery targets: + +1. **Existing MiSTer:** a checked FAT-volume overlay, copied directly or installed + over passwordless SSH. This is implemented by tools/release.py and + tools/install_mister.py. +2. **Dedicated Coco 3 Plus card:** a bootable image containing the standard + MiSTer system plus the same overlay, suitable for balenaEtcher. The image + builder and first-boot qualification are a separate delivery step; no bootable + Plus image is claimed by the core build or overlay packaging command. + +MiSTer Linux and its boot files reside on the microSD card. It is not sufficient +to put a core RBF and games on a blank FAT32 card and rely on an onboard OS. + +[Mr. Fusion](https://github.com/MiSTer-devel/mr-fusion) is the existing starter +system. Its compact image boots a small installer, expands/prepares the card, +installs MiSTer and reboots. Its documented image-writing tools include Etcher. +Using its existing release/system assets avoids building a new Linux distribution. +Its upstream full image builder currently uses a privileged Linux/Docker flow; +that is distinct from our native Windows FPGA/tool/ROM build. + +For a dedicated release, pin the Mr. Fusion and MiSTer system versions and +checksums, preserve their licenses, then integrate the already verified Plus +overlay into the image's installation payload. Confirm exactly when the +installer consumes/deletes its staging partition before injecting files: copying +arbitrary assets beside Scripts is not a documented automatic full-root overlay +mechanism. Include only approved software-library content, no owner credentials, +SSH host keys or personal device configuration. Choose a dedicated startup +configuration deliberately while retaining a way back to MENU. + +Qualification must include flashing a spare card, first-boot expansion on the +actual DE10-Nano, offline/online behavior, automatic SSC ROM availability when +legitimately supplied, readable/writable disks, saved settings and a cold power +cycle. Never replace an existing owner's primary card as an incidental test. +The same core/ROM/file manifest should identify both distribution forms so they +cannot drift into different products. diff --git a/docs/VALIDATION.md b/docs/VALIDATION.md new file mode 100644 index 0000000..03d9d1a --- /dev/null +++ b/docs/VALIDATION.md @@ -0,0 +1,132 @@ +# Validation and acceptance scope + +## Final named release, 2026-11-18 + +The final source embeds **Coco 3 Plus** as its display identity and retains +`coco3plus` as its native MGL profile. Original contribution copyright notices +are added without replacing upstream notices. A fresh native Quartus17.0.2 +seed5 compile completes in **14:33**, **0 errors / 73 warnings**. It uses +**19,067 ALMs (45%)**, **495 RAM blocks (90%)** and produces a **3,946,736-byte** RBF: + +```text +768ee9db2923bf7b7acf7f57473c6c56f92d14ffc6d6bd88719148f80c9a2d42 +``` + +Minimum constrained slack: setup **+0.089 ns**, hold **+0.212 ns**, recovery +**+0.691 ns**, removal **+0.701 ns**, pulse width **+0.396 ns**. All 15 functional +jobs pass through the documented Windows entry point using the standalone +checkout's own verified/extracted simulator. The actual Main name-reader +fixture additionally confirms the spaced display name and unchanged canonical +profile override. All **368 fitted report scopes** pass, with remaining optional +pin contracts explicitly classified in validation/standalone.json. No timing +exceptions or physical delay assumptions were relaxed for the rename. + +Release-tool review adds eight passing integrity tests: committed-only source +export excludes untracked notes and ROMs, public packages omit firmware, dirty +selected sources stop packaging, incomplete simulator setup stays unpublished, +and same-size binary corruption is detected. New HDL dependencies use a maintained +inventory; the build receipt reads the actual QSF seed. Resumed timing audits +require the original RBF, fitted netlist, input and Tcl-script identities. Older +unbound evidence is deliberately rejected; all 368 scopes were rerun with the +bound evidence format. These tooling corrections do not alter the fitted RTL. + +This is a new bitstream, so previous extensive hardware observations below +belong to the earlier hash. Final deployment/startup observations are separately +recorded in validation/deployment.json. The shared logical implementation is +covered by the final-source regressions; no new human listening or cold-power +test is inferred merely from that relationship. + +## First standalone reconstruction, 2026-11-18 + +The new repository was created from a complete upstream mirror, with no research +repository ancestry. The baseline is +`8b8cf72d1fb4de1d05345de8d5b92ec2d500fcd2`; original upstream refs are recorded in +validation/upstream-refs.json. The consolidated implementation is maintained on +main. Source-import hashes record the qualified implementation inputs and three +project-description comment rewrites; no private conversation/evidence archive +is required to build this project. + +All public dependencies were freshly downloaded and hash-verified from the new +repository's scripts. Native Windows LWASM 4.25 assembled all four ToolShed ROMs +to the expected SHA-256 values. SSC original inputs were separately verified and +remain ignored. No VCC Plus checkout/build or private emulator binary was used +for this standalone build or these regressions. + +The first standalone Quartus **17.0.2 Build 602** compile, seed 5, completed in +**14:38**, with **0 errors and 73 warnings**. Utilization is **19,098 ALMs (46%)**, +**495 RAM blocks (90%)** and 3,897,605 block-memory bits (69%). The RBF is +3,951,104 bytes, SHA-256: + +```text +a4b6ef0b3641bbbc1b42de88502b677a1ec5e3809e2a17abf6f1e75c2a38451e +``` + +This first build is byte-identical to the previously qualified and hardware-tested +image. It still reported the retired COCO3-BH embedded identity, which the final +release changes to Coco 3 Plus. Its fit has minimum constrained setup **+0.069 ns**, hold **+0.252 ns**, +recovery **+0.692 ns**, removal **+0.742 ns**, pulse width **+0.396 ns** and summary +TNS zero. Generated build logs and exact source hashes remain under ignored build +storage; the sanitized reproducibility record is validation/standalone.json. + +All **15 standalone functional jobs** pass: MPI allocation/config/router and actual +core bindings; original-ROM SSC system; registered interfaces; reset/buffer +domains; exhaustive keyboard phase; peripheral phase; SDRAM commands; delayed +CPU/video data; audio; pixel; I2C; original Main startup parser; original Main menu +parser; original/candidate video comparison. Negative controls include incorrect +buffer cadence, pixel duty/address corruption and old initialization behavior. + +All seven native detailed timing audits pass **368 report scopes** at both slow +and fast corners. This includes 34 MPI reports, 144 live SSC path reports, +CPU/reset/NMI/UART/video scopes, and 48 substantive conditional external-I/O +reports. Explicitly empty synchronous-only recovery/removal subscopes are listed +as empty, not counted as an observed path with positive slack. + +The first exported test run found missing dynamically named reset benches, a +canonical-name fixture mismatch, and a video-runner argument mismatch. These +were export-harness defects; corrected fixtures pass in a fresh output folder. +No RTL/timing exceptions were changed to satisfy the exported tests. + +## Hardware evidence on these exact RBF bytes + +Previous physical validation of the same image includes normal Disk BASIC startup, +saved non-default socket layout, Slot1/Slot4 ROM autoload, independent socket +banks/selectors, fresh configuration boot and Colour Lab grid/ramp/stripes/return. +Further autonomous checks include: + +- 14 guided Sound Lab cases plus repeated/FF-operand cases: 20 transaction + records across seven validated saved reports. One deliberate active-speech + abort/reset returns to normal operation and completes the full greeting. +- Disk BASIC formatting of an authored scratch disk, writing and reading 256 + exact numeric pairs across two granules; guest sums and host extraction agree. +- Supplied 512K RAM stress advancing pages for 135 seconds with no error display. +- Quadrapassel startup, keyboard movement, pause and quit. +- Mouse-as-right-joystick axes and button1 changes. + +Human SSC audibility was confirmed during earlier integration checks. The later +autonomous report marks remain UNSURE/NOT_OBSERVED; no new listening score is +manufactured from screenshots or transaction completion. An earlier hardware +game check also confirmed USB joystick/game audio, with separate build attribution. + +The initial standalone installer/path activation reached BASIC, `PRINT 1+1` +returned 2 and the OSD reported automatic Sound & Speech ready and Orchestra90 +enabled. The saved CFG and stock RBF were preserved. Final renamed-image +activation is recorded separately in validation/deployment.json. Rebuilding identical bytes +does not itself prove a newly changed launcher/installer path works. + +## Explicit remaining limits + +The native external constraints use the controller's documented Alliance -7 +SDRAM and bounded board-delay assumptions. The enclosed development module's +exact chip/speed suffix and PCB delays have not been independently measured. +This is conditional timing closure, not universal SDRAM-module or whole-board +electrical certification. Some HPS/muxed/asynchronous optional pins have separate +contracts outside these fabric STA budgets. + +Cold power removal/reapplication remains a physical operator check. Longer memory +stress, every turbo/large-memory setting, all UART/serial electrical paths, every +SDC/VHD/OS9 and cassette-write format, all joystick types and exhaustive waveform +equivalence remain outside the enumerated acceptance scope. Firmware diagnostics +and human listening complement rather than replace timing/simulation evidence. + +A dedicated bootable SD image requires separate first-boot/expansion/cold-start +qualification on a spare card; a verified core overlay is not that qualification. diff --git a/external-io.sdc b/external-io.sdc new file mode 100644 index 0000000..4ccf808 --- /dev/null +++ b/external-io.sdc @@ -0,0 +1,78 @@ +# Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +# Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +# MiSTer board interface profile; see docs/experiments/EXTERNAL_IO_TIMING.md. +# Alliance AS4C32M16SB -7, CL3. External round trip <= 0.50 ns; +# data-to-clock PCB skew bounded by +/-0.25 ns (SDRAM writes and HDMI). +# These are explicit design bounds, NOT measured facts about an installed kit. +# A negative result must remain negative. Read hold is never waived. +set mem_clock {emu|pll|pll_inst|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk} +set sys_clock {emu|pll|pll_inst|altera_pll_i|general[1].gpll~PLL_OUTPUT_COUNTER|divclk} +set hd_clock {pll_hdmi|pll_hdmi_inst|altera_pll_i|cyclonev_pll|counter[0].output_counter|divclk} +foreach n [list $mem_clock $sys_clock $hd_clock] { + if {[get_collection_size [get_pins $n]] != 1} {error "Missing exact external-interface clock pin $n"} +} +set pixel [get_registers {*|MISTER_COCOVID|PIX_CLK}] +if {[get_collection_size $pixel] != 1} {error "Expected one divide-by-four pixel register"} +create_generated_clock -name coco_pixel -source [get_pins $sys_clock] -edges {3 7 11} $pixel +create_generated_clock -name sdram_forward -source [get_pins $mem_clock] -divide_by 1 -invert [get_ports SDRAM_CLK] +set dq [get_ports {SDRAM_DQ[*]}] +if {[get_collection_size $dq] != 16} {error "Expected sixteen SDRAM DQ pins"} +set_input_delay -clock sdram_forward -max 5.90 $dq +set_input_delay -clock sdram_forward -min 2.50 $dq +# This is the preceding output-launch beat: CL3 READ T4 -> launch T6, +# receive T7. READY retains its original alignment (READ_CAPTURE_EXTRA=0). +# A setup-only edge shift intentionally tightens hold by a cycle. +# Do NOT append the usual enable-multicycle hold compensation here. +set capture [get_registers {*|coco3_sdram|dq_reg[*]}] +if {[get_collection_size $capture] != 16} {error "Expected sixteen SDRAM capture registers"} +set_multicycle_path -setup 2 -from $dq -to $capture +set mem_outputs [get_ports {SDRAM_A[*] SDRAM_BA[*] SDRAM_n* SDRAM_DQM* SDRAM_DQ[*]}] +if {[get_collection_size $mem_outputs] != 37} {error "Expected 37 SDRAM output/bidirectional pins"} +set_output_delay -clock sdram_forward -max 1.75 $mem_outputs +set_output_delay -clock sdram_forward -min -1.05 $mem_outputs +create_generated_clock -name hdmi_scaled_forward -source [get_pins $hd_clock] -divide_by 1 -invert [get_ports HDMI_TX_CLK] +create_generated_clock -name hdmi_direct_forward -source [get_pins $sys_clock] -divide_by 1 -invert -add [get_ports HDMI_TX_CLK] +# Carry the existing platform clock groups through the newly named descendants. +# HDMI data registers are clocked by the same selected mux as their DDIO clock. +set_clock_groups -exclusive \ + -group [get_clocks {*|pll|pll_inst|altera_pll_i|*[*].*|divclk coco_pixel sdram_forward hdmi_direct_forward}] \ + -group [get_clocks {pll_hdmi|pll_hdmi_inst|altera_pll_i|*[0].*|divclk hdmi_scaled_forward}] \ + -group [get_clocks {*|pll_audio_inst|altera_pll_i|*[0].*|divclk}] \ + -group [get_clocks spi_sck] -group [get_clocks hdmi_sck] \ + -group [get_clocks {*|h2f_user0_clk}] \ + -group [get_clocks FPGA_CLK1_50] -group [get_clocks FPGA_CLK2_50] -group [get_clocks FPGA_CLK3_50] +set video [get_ports {HDMI_TX_D[*] HDMI_TX_DE HDMI_TX_HS HDMI_TX_VS}] +if {[get_collection_size $video] != 27} {error "Expected 27 HDMI video data/control pins"} +foreach clk {hdmi_scaled_forward hdmi_direct_forward} { + set_output_delay -clock $clk -max 2.05 -add_delay $video + set_output_delay -clock $clk -min -1.55 -add_delay $video +} +# The real CE/serializer is checked by scripts/test_external_audio.py at both +# 48/96 kHz and during live switches. Data/LRCLK setup >=5 audio fabric cycles, +# hold >=3. Bound each output's absolute arrival, INCLUDING clock insertion, +# to 0..40 ns. The 40.682 ns fabric period leaves >79 ns receiver hold margin +# even at opposite output extrema, after the 2 ns/0.25 ns external allowance. +set i2s_regs [get_registers {audio_out|i2s|sclk audio_out|i2s|lrclk audio_out|i2s|sdata}] +set i2s_ports [get_ports {HDMI_SCLK HDMI_LRCLK HDMI_I2S}] +if {[get_collection_size $i2s_regs] != 3 || [get_collection_size $i2s_ports] != 3} {error "Expected three actual I2S output registers and pins"} +set_max_delay 40.0 -from $i2s_regs -to $i2s_ports +set_min_delay 0.0 -from $i2s_regs -to $i2s_ports +# MCP23009 fast-mode profile: 250 kHz, >=2 us half-periods. The independent +# protocol checker covers 0/300 ns edge extrema. A 40 ns fabric propagation +# envelope leaves low >=1660 ns and high >=1660 ns, beyond 1300/600 ns minima. +# Slave tAA <=900 ns, SDA edge <=300 ns, SCL fall <=300 ns and two fabric +# envelopes <=80 ns leave >=420 ns before the next 2 us sample slot. +# No fictitious external synchronous clock. +set io_drive [get_registers {mcp23009|i2c|I2C_CLOCK mcp23009|i2c|SCLK mcp23009|i2c|SDO[19]}] +set io_sample [get_registers {mcp23009|i2c|ACK mcp23009|i2c|rdata[*]}] +# get_registers includes fitted physical duplicates of a logical register. +# Require every logical boundary, and constrain all returned clones as well. +foreach io_role {mcp23009|i2c|I2C_CLOCK mcp23009|i2c|SCLK mcp23009|i2c|SDO[19]} { + if {[get_collection_size [get_registers $io_role]] < 1} {error "Missing MCP I2C drive boundary $io_role"} +} +if {[get_collection_size $io_drive] < 3 || [get_collection_size $io_sample] < 6} {error "MCP I2C pin boundaries changed"} +set_max_delay 40.0 -from $io_drive -to [get_ports {IO_SDA IO_SCL}] +set_min_delay 0.0 -from $io_drive -to [get_ports {IO_SDA IO_SCL}] +set_max_delay 40.0 -from [get_ports IO_SDA] -to $io_sample +set_min_delay 0.0 -from [get_ports IO_SDA] -to $io_sample +derive_clock_uncertainty diff --git a/files.qip b/files.qip index 158d7f8..87db482 100644 --- a/files.qip +++ b/files.qip @@ -1,3 +1,5 @@ +# Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +# Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. set_global_assignment -name VHDL_FILE rtl/sram/coco_ram.vhd set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_cart.vhd set_global_assignment -name VHDL_FILE rtl/rom/coco3_char_rom.vhd @@ -37,3 +39,26 @@ set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_8K.vhd set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_16.vhd set_global_assignment -name VHDL_FILE rtl/OVO.vhd set_global_assignment -name SDC_FILE rtl/CoCo3FPGA.sdc + +set_global_assignment -name SYSTEMVERILOG_FILE rtl/cpu_sdram_bridge.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_host.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_glue.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_ay8913.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_tms7000_alu.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_tms7000_bcd.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_tms7000_decode.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_tms7000_exec.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_tms7000_io.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_tms7000_memory.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_tms7000_pacer.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_tms7000.sv +set_global_assignment -name SEARCH_PATH rtl/ssc +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_sp0256_memory.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_sp0256.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_audio.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_cartridge.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/ssc/ssc_mister_bridge.sv + +set_global_assignment -name SYSTEMVERILOG_FILE rtl/bh_mpi_config.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/bh_mpi_router.sv +set_global_assignment -name SYSTEMVERILOG_FILE rtl/bh_mpi_rom.sv diff --git a/reset-cpu.sdc b/reset-cpu.sdc new file mode 100644 index 0000000..b9f285f --- /dev/null +++ b/reset-cpu.sdc @@ -0,0 +1,43 @@ +# Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +# Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +# Proven only for this MiSTer wrapper: Q=E=cpu_cycle_ena cannot be consecutive. +# See scripts/check_cpu_enable.py (actual timing-loop induction + negative test). +# Only BOTH endpoints in the qualified CPU Q/E write processes get two cycles. +set cpu_ce_bases {CpuState DMABREQLatched DMABREQSample DMABREQSample2 FIRQSample FIRQSample2 FIRQLatched HALTLatched HALTSample HALTSample2 IRQSample IRQSample2 IRQLatched Inst1 Inst2 Inst3 InstPage2 InstPage3 IntType NMIClear NMISample NMISample2 NextState a addr b cc dp ea pc rnRESET s tmp u x y} +set cpu_ce [get_registers -nowarn __no_cpu_register__] +foreach_in_collection reg [get_registers {*GLBCPU09|*}] { + set name [get_register_info -name $reg] + if {![regexp {GLBCPU09\|([A-Za-z_][A-Za-z_0-9]*)} $name unused base]} {error "Unrecognized CPU register $name"} + if {[lsearch -exact $cpu_ce_bases $base] >= 0} { + set one [get_registers -no_duplicates [list $name]] + if {[get_collection_size $one] != 1} {error "Ambiguous CPU register $name"} + set cpu_ce [add_to_collection $cpu_ce $one] + } +} +# Unnamed fitter/retiming nodes and unconditional NMI state remain single-cycle. +if {[get_collection_size $cpu_ce] < 200} {error "Incomplete Q/E-qualified CPU register scope"} +puts "CPU_CE_REGISTER_COUNT [get_collection_size $cpu_ce]" +set_multicycle_path -setup -end 2 -from $cpu_ce -to $cpu_ce +set_multicycle_path -hold -end 1 -from $cpu_ce -to $cpu_ce + +# Raw request reaches only the asynchronous pins of the two release stages. +# Internal stage-to-stage data and ALL downstream release paths stay timed. +set request [get_nets {*coco3|RESET_P}] +set release [get_registers {*coco3|reset_request_release[*]}] +if {[get_collection_size $request] != 1 || [get_collection_size $release] != 2} {error "Missing exact reset request synchronizer scope"} +set_false_path -through $request -to $release + +# Optional local positive-edge WD1793 release chains: asynchronous entry only. +set wd_release [get_registers -nowarn {*coco_fdc|wd_reset_release[*] *coco_sdc_top|wd_reset_release[*]}] +if {[get_collection_size $wd_release] > 0} { + if {[get_collection_size $wd_release] != 4} {error "Expected two two-stage WD reset chains"} + set reset_root [get_registers -nowarn -no_duplicates {*coco3|RESET_N *coco3|reset_main_release[1]}] + if {[get_collection_size $reset_root] != 1} {error "Missing exact disk reset root"} + set_false_path -from $reset_root -to $wd_release +} + +set phase_release [get_registers -nowarn {*coco3|reset_main_release[*] *coco3|reset_positive_release[*] *coco3|reset_fast_release[*]}] +if {[get_collection_size $phase_release] > 0} { + if {[get_collection_size $phase_release] != 6} {error "Expected exactly three two-stage consumer release chains"} + set_false_path -from [get_registers {*coco3|RESET_RAW_N}] -to $phase_release +} diff --git a/roms/README.md b/roms/README.md new file mode 100644 index 0000000..8cfca02 --- /dev/null +++ b/roms/README.md @@ -0,0 +1,23 @@ +# Local ROM inputs + +Everything in this folder except this README is ignored by Git. Public build +downloads do not supply the Sound & Speech chip contents. Obtain your own copies +and place these original, unmodified files in `roms/ssc/`: + +| File | Bytes | SHA-256 | +|---|---:|---| +| pic-7040-510.bin | 4096 | 0013cd78482cc5f2360fdf584e9ba51d34861e8ccd9d88247f1a54039c16c365 | +| sp0256-al2.bin | 2048 | 98c280fd082169c54081e503dfe7d7d9a6fd46d4ffcc973e199ea0e1d9bc1ac9 | + +These are the controller firmware and SP0256-AL2 speech ROM identities used by +the implementation and original-firmware tests. The installer rejects changed +sizes/hashes. It copies their original bytes into games/coco3plus and writes +native MiSTer remembered-file records for automatic loading. No firmware is baked +into the RBF; a CoCo reset preserves valid loaded ROMs, while reconfiguring the +FPGA requires the files to be loaded again. + +CoCo boot ROMs are assembled separately from pinned ToolShed sources by +tools/build_roms.py and staged under build/roms. Neither the source download nor +this repository grants permission to distribute third-party ROM content. +Local release overlays can contain your ROM inputs: review their redistribution +rights before sharing them. SSC can be omitted with `-WithoutSSC`. diff --git a/rtl/CoCo3FPGA.sdc b/rtl/CoCo3FPGA.sdc index 730290d..8715b57 100644 --- a/rtl/CoCo3FPGA.sdc +++ b/rtl/CoCo3FPGA.sdc @@ -1,11 +1,5 @@ -create_clock -period 1000.000 -name img_mounted[5] [get_nodes emu:emu|hps_io:hps_io|img_mounted[5]] -create_clock -period 1000.000 -name img_mounted[4] [get_nodes emu:emu|hps_io:hps_io|img_mounted[4]] -create_clock -period 1000.000 -name img_mounted[3] [get_nodes emu:emu|hps_io:hps_io|img_mounted[3]] -create_clock -period 1000.000 -name img_mounted[2] [get_nodes emu:emu|hps_io:hps_io|img_mounted[2]] -create_clock -period 1000.000 -name img_mounted[1] [get_nodes emu:emu|hps_io:hps_io|img_mounted[1]] -create_clock -period 1000.000 -name img_mounted[0] [get_nodes emu:emu|hps_io:hps_io|img_mounted[0]] -create_clock -period 1000.000 -name RESET_N [get_nodes emu:emu|coco3fpga:coco3|RESET_N] -create_clock -period 1000.000 -name NMISample2 [get_nodes emu:emu|coco3fpga:coco3|mc6809x:GLBCPU09|NMISample2] +# Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +# Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. #set_false_path -from [get_nodes sysmem_lite:sysmem|sysmem_HPS_fpga_interfaces:fpga_interfaces|clocks_resets~FF_4365] #create_clock -period 17.46 -name PH_2 [get_nodes emu:emu|coco3fpga:coco3|PH_2_RAW] #create_clock -period 1000.000 -name CLK_6551[4] [get_nodes emu:emu|coco3fpga:coco3|CLK_6551[4]] diff --git a/rtl/EE_Cold_Bt.v b/rtl/EE_Cold_Bt.v index cbc30bf..9c5c8cb 100644 --- a/rtl/EE_Cold_Bt.v +++ b/rtl/EE_Cold_Bt.v @@ -1,3 +1,5 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. //////////////////////////////////////////////////////////////////////////////// // Project Name: CoCo3FPGA Version 4.0 // File Name: EE_Cold_Bt.v @@ -66,6 +68,18 @@ output EE_to_COCO // Easter Egg to the coco3 ); //////////////////////////////////////////////////////////// +// Research: qualify slow-domain control before its program-decode logic. +(* preserve *) reg [1:0] boot_control_release = 2'b00; +(* preserve *) reg [1:0] display_control_release = 2'b00; +always @(posedge CLK or posedge RESET) + if (RESET) begin + boot_control_release <= 2'b00; + display_control_release <= 2'b00; + end else begin + boot_control_release <= {boot_control_release[0], Cold_Boot}; + display_control_release <= {display_control_release[0], Display_EE}; + end + reg Display_EE_D = 1'b0; reg Cold_Boot_D = 1'b0; wire Start_Display_EE, Start_Cold_Boot; @@ -103,8 +117,8 @@ localparam inst_SHORT_TIMER = 4'd5; localparam inst_LONG_TIMER = 4'd6; localparam inst_START = 4'd8; -assign Start_Display_EE = ((Display_EE == 1'b1) & (Display_EE_D == 1'b0)); -assign Start_Cold_Boot = ((Cold_Boot == 1'b1) & (Cold_Boot_D == 1'b0)); +assign Start_Display_EE = ((display_control_release[1] == 1'b1) & (Display_EE_D == 1'b0)); +assign Start_Cold_Boot = ((boot_control_release[1] == 1'b1) & (Cold_Boot_D == 1'b0)); always @ (posedge CLK or posedge RESET) @@ -121,8 +135,8 @@ begin end else begin - Display_EE_D <= Display_EE; - Cold_Boot_D <= Cold_Boot; + Display_EE_D <= display_control_release[1]; + Cold_Boot_D <= boot_control_release[1]; next_instruction <= 1'b0; diff --git a/rtl/UART_6551/6551rx.v b/rtl/UART_6551/6551rx.v index 0be834b..2e8fa85 100644 --- a/rtl/UART_6551/6551rx.v +++ b/rtl/UART_6551/6551rx.v @@ -1,3 +1,5 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. //////////////////////////////////////////////////////////////////////////////// // Project Name: CoCo3FPGA Version 4.0 // File Name: 6551rx.v @@ -167,6 +169,7 @@ begin RX_DATA0 <= 1'b1; RX_DATA1 <= 1'b1; READY <= 1'b0; + PARITY_ERR <= 1'b0; end else begin diff --git a/rtl/UART_6551/uart_6551.v b/rtl/UART_6551/uart_6551.v index d9fee07..e4e80a4 100644 --- a/rtl/UART_6551/uart_6551.v +++ b/rtl/UART_6551/uart_6551.v @@ -1,3 +1,5 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. //////////////////////////////////////////////////////////////////////////////// // Project Name: CoCo3FPGA Version 4.0 // File Name: uart_6551.v @@ -133,6 +135,7 @@ reg TX_START; reg TDRE; reg RDRF; reg [10:0] TX_CLK_DIV; +reg [3:0] baud_select; wire TX_CLK; wire RX_CLK; wire FRAME_BUF; @@ -151,6 +154,22 @@ reg [1:0] READ_STATE; wire GOT_DATA; reg READY0; reg READY1; +// Research: independent async-assert, synchronous-release reset trees. +// CPU state consumes falling edges; release its reset on rising edges. +(* preserve *) reg [1:0] cpu_reset_release = 2'b00; +(* preserve *) reg [1:0] serial_reset_release = 2'b00; +wire CPU_RESET_N = cpu_reset_release[1]; +wire SERIAL_RESET_N = serial_reset_release[1]; +wire SOFTWARE_RESET = ({RW_N, CS, RS} == 5'b00101); +always @(posedge CLK or negedge RESET_N) + if (!RESET_N) cpu_reset_release <= 2'b00; + else cpu_reset_release <= {cpu_reset_release[0], 1'b1}; +// Software reset request is held in the CPU domain until its next bus event. +// Only these synchronizer async inputs see the unsynchronized reset sources. +always @(posedge CLK or negedge RESET_X) + if (!RESET_X) serial_reset_release <= 2'b00; + else serial_reset_release <= {serial_reset_release[0], 1'b1}; + /* Baud rate divisors (for toggle of baud clock bit) @@ -173,16 +192,23 @@ F 19200 3 //assign TX_CLK_REG = TX_CLK_REG_T & XTAL_CLK_IN; -always @ (negedge CLK or negedge RESET_X) +always @ (negedge CLK or negedge SERIAL_RESET_N) begin - if(!RESET_X) + if(!SERIAL_RESET_N) begin TX_CLK_DIV <= 11'h000; + baud_select <= 0; TX_CLK_REG_T <= 1'b0; TX_CLK_REG <= 1'b0; end - else - begin + else if (baud_select != CTL_REG[3:0]) begin + baud_select <= CTL_REG[3:0]; + TX_CLK_DIV <= 0; + TX_CLK_REG_T <= 0; + TX_CLK_REG <= 0; + end + else + begin TX_CLK_REG <= 1'b0; if (XTAL_CLK_IN) begin @@ -314,9 +340,10 @@ assign RX_CLK = (CTL_REG[4] == 1'b0) ? RX_CLK_IN: assign RESET_X = RESET_NX ? 1'b0: RESET_N; -always @ (negedge CLK) +always @ (negedge CLK or negedge SERIAL_RESET_N) begin - if (TX_CLK) + if (!SERIAL_RESET_N) LOOPBACK <= 0; + else if (TX_CLK) LOOPBACK <= {LOOPBACK[6:0], TX_DATA}; //half bit time FIFO end @@ -347,9 +374,9 @@ assign STOP = (CTL_REG[7] == 1'b0) ? 1'b0: // Stop = 1 assign PAR_DIS = ~CMD_REG[5]; assign WORD_SELECT = CTL_REG[6:5]; -always @ (negedge CLK or negedge RESET_N) +always @ (negedge CLK or negedge CPU_RESET_N) begin - if(!RESET_N) + if(!CPU_RESET_N) RESET_NX <= 1'b1; else begin @@ -361,9 +388,29 @@ begin end end -always @ (negedge CLK or negedge RESET_X) +always @ (negedge CLK or negedge CPU_RESET_N) begin - if(!RESET_X) + if(!CPU_RESET_N) + begin + RDRF <= 1'b0; + READ_STATE <= 2'b00; + TX_BUFFER <= 8'h00; + CTL_REG <= 8'h00; +// Commador data sheet says reset value is 02 +// but Apple will not work unless it is 00 + CMD_REG <= 8'h00; + TDRE <= 1'b1; + TX_START <= 1'b0; + RX_REG <= 8'h00; + OVERRUN <= 1'b0; + FRAME <= 1'b0; + PARITY <= 1'b0; + TX_DONE1 <= 1'b1; + TX_DONE0 <= 1'b1; + READY0 <= 1'b0; + READY1 <= 1'b0; + end + else if (RESET_NX || (PH_2 && SOFTWARE_RESET)) begin RDRF <= 1'b0; READ_STATE <= 2'b00; @@ -477,7 +524,7 @@ begin end uart51_tx tx( -.RESET_N(RESET_X), +.RESET_N(SERIAL_RESET_N), .CLK(CLK), .BAUD_CLK(TX_CLK), .TX_DATA(TX_DATA), @@ -492,7 +539,7 @@ uart51_tx tx( ); uart51_rx rx( -.RESET_N(RESET_X), +.RESET_N(SERIAL_RESET_N), .CLK(CLK), .BAUD_CLK(RX_CLK), .RX_DATA(RX_DATA), diff --git a/rtl/bh_mpi_config.sv b/rtl/bh_mpi_config.sv new file mode 100644 index 0000000..e40ed03 --- /dev/null +++ b/rtl/bh_mpi_config.sv @@ -0,0 +1,79 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Coco 3 Plus persistent four-slot layout. Main's normal status exchange owns +// storage; this module migrates old settings and moves singleton devices. +module bh_mpi_config( + input wire clk,reset,input wire [63:0] requested, + output reg [63:0] accepted=0, + output reg [63:0] status_in=0,output reg status_set=0); +// Each slot: 0 empty,1 ROM,2 floppy,3 SDC,4 SSC,5 Orchestra,6 legacy audio, +// 7 RS232. Audio is an explicitly named convenience combination preserving the old +// independent Orchestra plus switchable SSC, not a physical cartridge claim. +localparam [11:0] ORIGINAL={3'd2,3'd1,3'd3,3'd6}; +reg [63:0] last_requested=~64'd0; +reg pending=0; +reg host_started=0; +reg [63:0] next_status; +reg [11:0] layout; +reg [4:0] used,mask,remaining; +reg [2:0] kind; +reg has_ssc; +integer i,j,primary,order; +function [4:0] devices(input [2:0] k); + begin case(k) + 2:devices=1;3:devices=2;4:devices=4;5:devices=8; + 6:devices=12;7:devices=16;default:devices=0; + endcase end +endfunction +always_comb begin + next_status=requested; + if(!requested[63])begin + next_status[63]=1; + next_status[13:12]=requested[13:12]+2'd1; + next_status[54:43]=ORIGINAL; + end + layout=next_status[54:43];primary=0; + // Most recently edited slot wins; a persisted multi-edit has a deterministic + // highest changed slot. Read-only/default fields never move devices. + for(i=0;i<4;i=i+1) + if(layout[i*3+:3]!=accepted[43+i*3+:3])primary=i; + used=0; + for(order=0;order<5;order=order+1)begin + j=(order==0)?primary:order-1; + if(order==0||j!=primary)begin + kind=layout[j*3+:3];mask=devices(kind);remaining=mask&~used; + if(mask!=0&&remaining!=mask)begin + if(kind==6&&remaining==4)kind=4; + else if(kind==6&&remaining==8)kind=5; + else kind=0; + end + layout[j*3+:3]=kind;used=used|devices(kind); + end + end + next_status[54:43]=layout; + has_ssc=0; + for(i=0;i<4;i=i+1)has_ssc=has_ssc||layout[i*3+:3]==4||layout[i*3+:3]==6; + if(!has_ssc)next_status[42]=0; + if(requested[63]&&layout[primary*3+:3]==4&& + accepted[43+primary*3+:3]!=4)next_status[42]=1; +end +always @(posedge clk)begin + status_set<=0; + if(reset)begin + accepted<=0;last_requested<=~64'd0;pending<=0;status_in<=0;host_started<=0; + end else begin + if(requested[0])host_started<=1; + // Main polls status requests after every FC transfer; acknowledgement clears + // bit0. Publishing default migration during initialization would prematurely + // end its reset-held ROM-loading phase. Wait for Main's own final release, + // and never publish a pending snapshot while a newer host value is arriving. + if(host_started&&!requested[0]&&requested==last_requested&&pending&&!status_set) + begin status_set<=1;pending<=0;end + if(requested!=last_requested)begin + last_requested<=requested;accepted<=next_status; + status_in<=next_status;pending<=requested!=next_status; + end + end +end +endmodule diff --git a/rtl/bh_mpi_rom.sv b/rtl/bh_mpi_rom.sv new file mode 100644 index 0000000..54eb88a --- /dev/null +++ b/rtl/bh_mpi_rom.sv @@ -0,0 +1,129 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Four private ROM address spaces, up to128 KiB each, sharing256 KiB of16 KiB +// blocks. Four full128 KiB memories exceed this core's fitted M10K budget. +// Same synchronous read edge as the previous COCO_ROM_CART. Loading one slot +// never overwrites another or the built-in disk ROM. Partial/oversized streams +// cannot expose stale bytes as a successfully loaded cartridge. +module bh_mpi_rom( + input wire clk,power_reset,input wire [1:0] read_slot, + input wire [16:0] read_address,output wire [7:0] read_data, + input wire download,wr,input wire [7:0] file_index, + input wire [24:0] address,input wire [7:0] data, + output wire loading,output reg [3:0] valid=0,fault=0, + output reg loaded_pulse=0,input wire [3:0] enabled); +reg [7:0] memory[0:262143]; +reg [3:0] blocks[0:31]; +reg [15:0] owned[0:3]; +reg [15:0] used=0; +// HPS changes its bus on the opposite edge. Capture raw fields first; all +// allocation/validation/RAM write logic then has a full clock period rather +// than decoding HPS index and driving256 M10Ks in half a period. +reg p_download=0,p_wr=0; +reg [7:0] p_file_index=0,p_data=0; +reg [24:0] p_address=0; +reg [17:0] lengths[0:3]; +reg [16:0] masks[0:3]; +wire [5:0] index=p_file_index[5:0]; +wire selected=index==1||index==6||index==7||index==8||index==9; +wire [1:0] target=index==6?0:index==7?1:index==9?3:2; +reg active=0; +reg [1:0] slot; +reg [5:0] saved_index; +reg [17:0] count; +reg malformed; +reg [7:0] sampled; +reg sampled_valid=0; +reg [16:0] next_mask; +reg [15:0] start_used; +reg [15:0] released; +reg [4:0] available_block; +integer n; +integer k; +wire [16:0] offset=read_address&masks[read_slot]; +function [4:0] find_free(input [15:0] occupancy); + integer b; + begin find_free=16; + for(b=15;b>=0;b=b-1)if(!occupancy[b])find_free=b; + end +endfunction +always_comb begin + start_used=0;released=0; + for(k=0;k<4;k=k+1)begin + if(k!=target&&enabled[k])start_used=start_used|owned[k]; + if(!enabled[k])released=released|owned[k]; + end +end +wire raw_selected=file_index[5:0]==1||file_index[5:0]==6|| + file_index[5:0]==7||file_index[5:0]==8||file_index[5:0]==9; +wire [1:0] raw_target=file_index[5:0]==6?0:file_index[5:0]==7?1:file_index[5:0]==9?3:2; +assign loading=(download&&raw_selected&&enabled[raw_target])|| + (p_download&&selected&&enabled[target])||active; +assign read_data=sampled_valid?sampled:8'hff; +always @(posedge clk)begin + loaded_pulse<=0; + sampled<=memory[{blocks[{read_slot,offset[16:14]}],offset[13:0]}]; + sampled_valid<=valid[read_slot]&& + ({1'b0,(read_address&masks[read_slot])}=131072) + malformed<=1; + else if(!malformed)begin + if(p_address[13:0]==0)begin + available_block=find_free(used&~released); + if(available_block==16)malformed<=1; + else begin + blocks[{slot,p_address[16:14]}]<=available_block[3:0]; + used<=(used&~released)|(16'b1<>1);next_mask=next_mask|(next_mask>>2); + next_mask=next_mask|(next_mask>>4);next_mask=next_mask|(next_mask>>8); + next_mask=next_mask|(next_mask>>16); + masks[slot]<=next_mask;valid[slot]<=1;loaded_pulse<=1; + end else begin + valid[slot]<=0;fault[slot]<=1;lengths[slot]<=0; + used<=(used&~released)&~owned[slot];owned[slot]<=0; + end + end + end +end +endmodule diff --git a/rtl/bh_mpi_router.sv b/rtl/bh_mpi_router.sv new file mode 100644 index 0000000..f7ae5ee --- /dev/null +++ b/rtl/bh_mpi_router.sv @@ -0,0 +1,29 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// One shared engine per controller, independently placeable in four sockets. +// ROM and SCS selectors remain separate, software-addressable MPI fields. +module bh_mpi_router( + input wire [11:0] layout,input wire [1:0] cts,scs, + output wire [2:0] rom_kind,io_kind, + output wire floppy_io,sdc_io,rom_io,serial_io, + output reg ssc_present,orchestra_present,floppy_present,sdc_present); +assign rom_kind=layout[cts*3+:3]; +assign io_kind=layout[scs*3+:3]; +assign floppy_io=io_kind==2; +assign sdc_io=io_kind==3; +assign rom_io=io_kind==1||io_kind==5||io_kind==6; +// Legacy floppy/SDC setups include the existing RS232 endpoint. A separate +// RS232 device can also be assigned without requiring a storage controller. +assign serial_io=io_kind==2||io_kind==3||io_kind==7; +integer n; +always_comb begin + ssc_present=0;orchestra_present=0;floppy_present=0;sdc_present=0; + for(n=0;n<4;n=n+1)begin + ssc_present=ssc_present||(layout[n*3+:3]==4)||(layout[n*3+:3]==6); + orchestra_present=orchestra_present||(layout[n*3+:3]==5)||(layout[n*3+:3]==6); + floppy_present=floppy_present||(layout[n*3+:3]==2); + sdc_present=sdc_present||(layout[n*3+:3]==3); + end +end +endmodule diff --git a/rtl/coco3fpga.sv b/rtl/coco3fpga.sv index 5800d75..f76a636 100644 --- a/rtl/coco3fpga.sv +++ b/rtl/coco3fpga.sv @@ -1,3 +1,5 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. //////////////////////////////////////////////////////////////////////////////// // Project Name: CoCo3FPGA Version 5.x.x // File Name: coco3fpga.sv @@ -83,6 +85,17 @@ input CLK_57, input CLK_28, input CLK_14, +// Research cartridge extension; FPGA power reset is distinct from CoCo reset. +input SSC_POWER_RESET, +input SSC_MODE, +input [11:0] MPI_LAYOUT, +input MPI_BOOT_LOADING, +output [3:0] MPI_ROM_FAULT, +output MPI_ROM_LOADING, +output MPI_ROM_LOADED, +output SSC_READY, +output SSC_FAULT, + input COCO_RESET_N, // Video @@ -263,13 +276,28 @@ wire PH_2; `ifndef CoCo3_CYC_ACC_6809 reg PH_2_RAW; `endif -reg RESET_N; +reg RESET_RAW_N; +(* preserve *) reg [1:0] reset_main_release = 2'b00; +(* preserve *) reg [1:0] reset_positive_release = 2'b00; +(* preserve *) reg [1:0] reset_fast_release = 2'b00; +wire RESET_N = reset_main_release[1]; +wire RESET_POS_N = reset_positive_release[1]; +wire RESET_FAST_N = reset_fast_release[1]; +always @(negedge clk_sys or negedge RESET_RAW_N) + if (!RESET_RAW_N) reset_main_release <= 2'b00; + else reset_main_release <= {reset_main_release[0], 1'b1}; +always @(posedge clk_sys or negedge RESET_RAW_N) + if (!RESET_RAW_N) reset_positive_release <= 2'b00; + else reset_positive_release <= {reset_positive_release[0], 1'b1}; +always @(posedge CLK_114 or negedge RESET_RAW_N) + if (!RESET_RAW_N) reset_fast_release <= 2'b00; + else reset_fast_release <= {reset_fast_release[0], 1'b1}; reg [6:0] CPU_RESET_SM; reg CPU_RESET; wire RESET_INS; reg MUGS = 0; wire RESET; -wire RESET_P; +(* keep *) wire RESET_P; wire [15:0] ADDRESS; wire [11:0] BLOCK_ADDRESS; // 5:0 for 512kb wire RW_N; @@ -335,6 +363,29 @@ wire HDD_EN_DATA; reg [1:0] MPI_SCS; // IO select reg [1:0] MPI_CTS; // ROM select +wire [2:0] mpi_rom_kind,mpi_io_kind; +wire mpi_floppy_io,mpi_sdc_io,mpi_rom_io,mpi_serial_io; +wire mpi_ssc_present,mpi_orchestra_present,mpi_floppy_present,mpi_sdc_present; +bh_mpi_router mpi_router(.layout(MPI_LAYOUT),.cts(MPI_CTS),.scs(MPI_SCS), + .rom_kind(mpi_rom_kind),.io_kind(mpi_io_kind),.floppy_io(mpi_floppy_io), + .sdc_io(mpi_sdc_io),.rom_io(mpi_rom_io),.serial_io(mpi_serial_io), + .ssc_present(mpi_ssc_present),.orchestra_present(mpi_orchestra_present), + .floppy_present(mpi_floppy_present),.sdc_present(mpi_sdc_present)); +wire mpi_rom_selected=mpi_rom_kind==1||mpi_rom_kind==5||mpi_rom_kind==6; +wire [3:0] mpi_rom_valid; +wire [3:0] mpi_rom_enabled; +genvar mpi_rom_socket; +generate for(mpi_rom_socket=0;mpi_rom_socket<4;mpi_rom_socket=mpi_rom_socket+1)begin: rom_socket_enable + wire [2:0] device_kind=MPI_LAYOUT[mpi_rom_socket*3+:3]; + // Main parses FC records before loading its saved status/configuration. Keep + // startup transfers until that reset-held phase ends, then discard sockets + // absent from the restored layout. Ordinary reset does not reload FC files. + assign mpi_rom_enabled[mpi_rom_socket]=MPI_BOOT_LOADING||device_kind==1||device_kind==5||device_kind==6; +end endgenerate +wire ssc_mode_active=SSC_MODE&&mpi_ssc_present; +wire [7:0] mpi_orch_left=mpi_orchestra_present?ORCH_LEFT:8'h80; +wire [7:0] mpi_orch_right=mpi_orchestra_present?ORCH_RIGHT:8'h80; + reg SBS; reg [11:0] SAM00; // 8MB 5:0 for 512kb reg [11:0] SAM01; @@ -415,7 +466,9 @@ wire [7:0] DATA_HDD; wire RS232_EN; wire RX_CLK2; wire [7:0] DATA_RS232; -reg [2:0] ROM_BANK; +reg [2:0] rom_banks[0:3]; +wire [2:0] ROM_BANK=rom_banks[MPI_CTS]; +integer rom_bank_index; wire SLOT3_HW; reg TICK0; reg TICK1; @@ -570,6 +623,18 @@ reg ANALOG; wire VDAC_EN; wire [15:0] VDAC_OUT; +wire ssc_palette_owner,ssc_read_valid,ssc_files_valid,ssc_operational,ssc_chip_fault; +wire [7:0] ssc_read_data,ssc_host_data,ssc_chip_read_data,ssc_status; +wire [15:0] ssc_host_address,ssc_debug_pc; +wire ssc_host_read,ssc_host_write,ssc_cartridge_reset,ssc_chip_read_valid; +wire ssc_pic_begin,ssc_pic_write,ssc_speech_begin,ssc_speech_write; +wire [11:0] ssc_pic_address; +wire [10:0] ssc_speech_address; +wire [7:0] ssc_pic_data,ssc_speech_data; +wire ssc_pic_loaded,ssc_speech_loaded,ssc_audio_valid,ssc_standby,ssc_activity; +wire signed [15:0] ssc_audio; +wire [15:0] ssc_legacy_left,ssc_legacy_right; + wire CART_INT_N; reg CART_INT_N_D; wire VSYNC_INT_N; @@ -797,11 +862,8 @@ assign FLASH_ADDRESS = ENA_DSK ? {9'b000000000, ADDRESS[12:0] //10 32 Internal //11 32 External -assign FLASH_CE_S = ROM_SEL ? 1'b1: - ENA_DISK2 ? 1'b1: - ENA_PAK ? 1'b1: - ENA_DSK ? 1'b1: - 1'b0; +// Empty cartridge sockets read an open bus, not the internal system ROM. +assign FLASH_CE_S = ROM_SEL || CART_SEL; wire [7:0] COCO3_ROM_DATA; wire [7:0] COCO3_DISK_ROM_DATA; @@ -814,8 +876,9 @@ localparam [5:0] BOOT = 6'd0; wire COCO3_ROM_WRITE = (ioctl_index[7:0] == {BOOT0, BOOT}) & ioctl_wr; -wire COCO3_DISKROM_WRITE = (ioctl_index[7:0] == {BOOT1, BOOT}) & ioctl_wr; -wire COCO3_CART_WRITE = (ioctl_index[5:0] == 6'd1) & ioctl_wr & !cart_lock; +wire COCO3_DISKROM_WRITE = ((ioctl_index[7:0] == {BOOT1, BOOT}) || + (ioctl_index[5:0] == 6'd10)) & ioctl_wr; +// Program-ROM streaming and validity are owned by bh_mpi_rom below. reg rom_loaded = 1'b0; @@ -858,52 +921,34 @@ COCO_ROM_8K CC3_DISK_ROM( ); -assign FLASH_DATA = ENA_PAK ? CART_DATA: - (ENA_DSK || ENA_DISK2) ? COCO3_DISK_ROM_DATA: - COCO3_ROM_DATA; +assign FLASH_DATA = CART_SEL ? + (mpi_rom_selected ? CART_DATA : + (mpi_rom_kind==2||mpi_rom_kind==3) ? COCO3_DISK_ROM_DATA : 8'hff) : + COCO3_ROM_DATA; +bh_mpi_rom mpi_program_roms(.clk(~clk_sys),.power_reset(SSC_POWER_RESET), + .read_slot(MPI_CTS),.read_address(FLASH_ADDRESS[16:0]),.read_data(CART_DATA), + .download(ioctl_download),.wr(ioctl_wr),.file_index(ioctl_index[7:0]), + .address(ioctl_addr),.data(ioctl_data),.loading(MPI_ROM_LOADING), + .valid(mpi_rom_valid),.fault(MPI_ROM_FAULT),.loaded_pulse(MPI_ROM_LOADED), + .enabled(mpi_rom_enabled)); -COCO_ROM_CART CC3_ROM_CART( -.ADDR(FLASH_ADDRESS[16:0]), -.DATA(CART_DATA), -.CLK(~clk_sys), -.WR_ADDR(ioctl_addr[16:0]), -.WR_DATA(ioctl_data[7:0]), -.WRITE(COCO3_CART_WRITE) -); - -wire SDC_EN_CS; - -assign ENA_DISK2 = ({CART_SEL, MPI_CTS} == 3'b101) ? 1'b1: // Alternative Disk controller ROM up to 32K - 1'b0; - -assign ENA_PAK = ({CART_SEL, MPI_CTS} == 3'b110) ? 1'b1: // ROM SLOT 3 - 1'b0; - -assign ENA_DSK = ({CART_SEL, MPI_CTS} == 3'b111) ? 1'b1: // Disk C000-DFFF Slot 4 - 1'b0; +wire SDC_EN_CS; +assign ENA_DISK2=CART_SEL&&mpi_rom_kind==3; +assign ENA_PAK=CART_SEL&&mpi_rom_selected; +assign ENA_DSK=CART_SEL&&mpi_rom_kind==2; `ifdef CoCo3_sdc_fix_os9_driver -assign HDD_EN = ({ext_response, MPI_SCS, ADDRESS[15:5]} == 15'b01111111111010) ? 1'b1: // FF40-FF5F with MPI switch = 4 - 1'b0; - -assign SDC_EN_CS = (({MPI_SCS, ADDRESS[15:5]} == 13'b0111111111010) | - ((ADDRESS[15:5] == 11'b11111111010) & ext_response)) ? 1'b1: // FF40-FF5F with MPI switch = 2 - 1'b0; +assign HDD_EN=mpi_floppy_io&&ADDRESS[15:5]==11'h7fa&& + !(ext_response&&mpi_sdc_present); +assign SDC_EN_CS=(mpi_sdc_io||(ext_response&&mpi_sdc_present))&& + ADDRESS[15:5]==11'h7fa; `else -assign HDD_EN = ({MPI_SCS, ADDRESS[15:5]} == 13'b1111111111010) ? 1'b1: // FF40-FF5F with MPI switch = 4 - 1'b0; -assign SDC_EN_CS = ({MPI_SCS, ADDRESS[15:5]} == 13'b0111111111010) ? 1'b1: // FF40-FF5F with MPI switch = 2 - 1'b0; +assign HDD_EN=mpi_floppy_io&&ADDRESS[15:5]==11'h7fa; +assign SDC_EN_CS=mpi_sdc_io&&ADDRESS[15:5]==11'h7fa; `endif - -//assign RS232_EN = ({MPI_SCS, ADDRESS[15:2]} == 16'b0011111111011010) ? 1'b1: //FF68-FF6B - Now in slot 1 -// 1'b0 ; - -assign RS232_EN = ({MPI_SCS[0], ADDRESS[15:2]} == 15'b111111111011010) ? 1'b1: //FF68-FF6B - Now in slot 2 and 4 - 1'b0; - -assign SLOT3_HW = ({SWITCH[2:1], ADDRESS[15:5]} == 13'b1011111111010) ? 1'b1: // FF40-FF5F Ensure this only appears in slot 3 PHYSICALLY - 1'b0; +assign RS232_EN=mpi_serial_io&&ADDRESS[15:2]==14'h3fda; +// Bank writes follow the independently selected I/O socket. +assign SLOT3_HW=mpi_rom_io&&ADDRESS[15:5]==11'h7fa; assign VDAC_EN = ({RW_N,ADDRESS[15:0]} == 17'H0FF7E) ? 1'b1: // FF7E 1'b0; @@ -917,7 +962,8 @@ always @(negedge clk_sys or negedge RESET_N) begin if(!RESET_N) begin - ROM_BANK <= 3'b000; + for(rom_bank_index=0;rom_bank_index<4;rom_bank_index=rom_bank_index+1) + rom_banks[rom_bank_index] <= 3'b000; end else begin @@ -925,7 +971,7 @@ begin case (ADDRESS[4:0]) 5'h00: begin - ROM_BANK <= DATA_OUT[2:0]; + rom_banks[MPI_SCS] <= DATA_OUT[2:0]; end endcase end @@ -1067,13 +1113,14 @@ end assign DATA_IN = + ssc_read_valid ? ssc_read_data : (sdram_BE_0) ? hold_data_L[7:0]: (sdram_BE_1) ? hold_data_L[15:8]: FLASH_CE_S ? FLASH_DATA: SDC_EN_CS ? DATA_SDC: // needs priority due to nitros9 llcocosdc ddriver bug HDD_EN ? DATA_HDD: RS232_EN ? DATA_RS232: - SLOT3_HW ? {5'b00000, ROM_BANK}: + SLOT3_HW ? {5'b00000, rom_banks[MPI_SCS]}: // FF00, FF04, FF08, FF0C, FF10, FF14, FF18, FF1C ({ADDRESS[15:5], ADDRESS[1:0]} == 13'b11111111000_00) ? DATA_REG1: // FF01, FF05, FF09, FF0D, FF11, FF15, FF19, FF1D @@ -1205,10 +1252,20 @@ wire AMW_End; assign AMW_ACK = AMW_End; +// A ROM transfer holds the system reset. Its short completion pulse cannot +// survive the143ms system-release delay; retain the cold-start request until +// the real AMW sequencer reaches its ready state and consumes the first write. +reg mpi_rom_cold_pending=0; +always @(negedge clk_sys)begin + if(SSC_POWER_RESET)mpi_rom_cold_pending<=0; + else if(MPI_ROM_LOADING)mpi_rom_cold_pending<=1; + else if(AMW_EN)mpi_rom_cold_pending<=0; +end + AMW coco_AMW ( .CLK(clk_sys), .RESET_N(RESET_N), - .Trigger(AMW_Trigger), + .Trigger(AMW_Trigger || (mpi_rom_cold_pending && AMW_Ready)), .Restart(1'b0), .Cycle_Run(AMW_WR), .AMW_Adrs(AMW_Adrs), @@ -1224,6 +1281,14 @@ reg [15:0] hold_data, hold_data_L; reg RAM0_BE0_L, RAM0_BE1_L; reg clear_data_ready, data_ready; +// Research: matching fast-clock falling-edge observations of completion. +reg data_ready_phase; +reg [15:0] hold_data_phase; +always @(negedge CLK_114 or posedge clear_data_ready) + if (clear_data_ready) data_ready_phase <= 1'b0; + else data_ready_phase <= data_ready; +always @(negedge CLK_114) hold_data_phase <= hold_data; + always @(posedge CLK_114 or posedge clear_data_ready) begin if (clear_data_ready) @@ -1314,14 +1379,14 @@ begin // If we are in hold were done @ data_ready. if (hold) begin - if (data_ready) + if (data_ready_phase) begin // Hold states are done - kill hold and set end hold to drive data hold <= 1'b0; end_hold <= 1'b1; cpu_cycle_ena <= 1'b1; // Cycle at the end of a memory transaction clear_data_ready <= 1'b1; - hold_data_L <= hold_data; + hold_data_L <= hold_data_phase; sdram_BE_0 <= RAM0_BE0_L; sdram_BE_1 <= RAM0_BE1_L; end @@ -1504,15 +1569,23 @@ begin MUGS <= RESET_INS; //This is holding a across a reset to activate the Easter Egg end -always @ (posedge clk_sys or posedge RESET_P) +// Research: asynchronous request assertion, two-edge synchronized release. +(* preserve, altera_attribute = "-name SYNCHRONIZER_IDENTIFICATION FORCED_IF_ASYNCHRONOUS" *) +reg [1:0] reset_request_release = 2'b00; +always @(posedge clk_sys or posedge RESET_P) + if (RESET_P) reset_request_release <= 2'b00; + else reset_request_release <= {reset_request_release[0], 1'b1}; +wire reset_request = !reset_request_release[1]; + +always @ (posedge clk_sys or posedge reset_request) begin reg [24:0] RESET_SM; - if(RESET_P) + if(reset_request) begin RESET_SM <= 25'd0; CPU_RESET <= 1'b1; - RESET_N <= 1'b0; + RESET_RAW_N <= 1'b0; end else begin @@ -1521,7 +1594,7 @@ begin // Take away RESET_N // Leave CPU_RESET Asserted begin - RESET_N <= 1'b1; + RESET_RAW_N <= 1'b1; CPU_RESET <= 1'b1; RESET_SM <= RESET_SM + 1'b1; end @@ -1529,7 +1602,7 @@ begin // Take away RESET_N & CPU_RESET // Stop RESET_SM count begin - RESET_N <= 1'b1; + RESET_RAW_N <= 1'b1; CPU_RESET <= 1'b0; end default: @@ -1617,7 +1690,7 @@ wire BUFFER_WRITE; coco_mem_fetch video_fetch( .fast_clk(CLK_114), - .RESET_N(RESET_N), + .RESET_N(RESET_FAST_N), // Memory Controller I/O .SDRAM_VID_REQ(sdram_vid_req), @@ -1780,58 +1853,15 @@ sdc_top coco_sdc_top( ); -reg cart_firq_enable; - -reg firq_trig; -reg cart_lock; - -always @(negedge clk_sys or negedge RESET_N) -begin - if(!RESET_N) - begin - firq_trig <= 1'b0; - cart_firq_enable <= 1'b1; - cart_lock <= 1'b0; - end - else - begin - if ((ioctl_index[5:0] == 6'd1) & ioctl_download) - firq_trig <= 1'b1; - - if (firq_trig) - if (!ioctl_download) - begin - cart_firq_enable <= 1'b0; - cart_lock <= 1'b1; - end - end -end - - -//*********************************************************************** -// Interrupt Sources -//*********************************************************************** -// Org FPGA code -always @(negedge clk_sys or negedge RESET_N) -begin - if(!RESET_N) - begin - CART_INT_IN_N <= 1'b1; - end - else - begin - if (PH_2) - case (MPI_SCS) - 2'b00: - CART_INT_IN_N <= (SER_IRQ); - 2'b01: - CART_INT_IN_N <= (SER_IRQ); - 2'b10: - CART_INT_IN_N <= (!CART_INT_IN_N | cart_firq_enable); - 2'b11: - CART_INT_IN_N <= (SER_IRQ); - endcase - end +// A loaded ROM drives the cartridge-present/autostart input only when CTS +// selects its socket. Serial IRQ retains its own selected-controller path. +always @(negedge clk_sys or negedge RESET_N)begin + if(!RESET_N)CART_INT_IN_N<=1; + else if(PH_2)begin + CART_INT_IN_N <= + (mpi_rom_selected&&mpi_rom_valid[MPI_CTS] ? !CART_INT_IN_N : 1'b1) & + (mpi_serial_io ? SER_IRQ : 1'b1); + end end assign CART_INT_N = CART_INT_IN_N; @@ -3017,11 +3047,11 @@ begin 16'hFF7A: begin - ORCH_LEFT <= DATA_OUT; + if(mpi_orchestra_present)ORCH_LEFT <= DATA_OUT; end 16'hFF7B: begin - ORCH_RIGHT <= DATA_OUT; + if(mpi_orchestra_present)ORCH_RIGHT <= DATA_OUT; end 16'hFF7F: begin @@ -3560,8 +3590,35 @@ end assign SOUND = SOUND_EN ? {SOUND_DTOA, 2'b00}: {SBS,SBS,SBS,SBS,SBS,SBS, 2'b00}; -assign SOUND_LEFT = {ORCH_LEFT, ORCH_LEFT} + {SOUND, SOUND}; -assign SOUND_RIGHT = {ORCH_RIGHT, ORCH_RIGHT} + {SOUND, SOUND}; +assign ssc_legacy_left = {mpi_orch_left,mpi_orch_left}+{SOUND,SOUND}; +assign ssc_legacy_right = {mpi_orch_right,mpi_orch_right}+{SOUND,SOUND}; + +ssc_mister_bridge ssc_bridge( + .clk(clk_sys),.reset(SSC_POWER_RESET),.cpu_reset(!RESET_POS_N),.mode(ssc_mode_active), + .cpu_commit(PH_2),.cpu_rnw(RW_N),.cpu_address(ADDRESS),.cpu_data(DATA_OUT), + .ioctl_download(ioctl_download),.ioctl_wr(ioctl_wr),.ioctl_index(ioctl_index[7:0]), + .ioctl_address(ioctl_addr),.ioctl_data(ioctl_data), + .cartridge_operational(ssc_operational),.cartridge_fault(ssc_chip_fault), + .cartridge_read_data(ssc_status),.cartridge_audio(ssc_audio), + .sound_enable(SOUND_EN),.sound_select(SEL),.orchestra_left(mpi_orch_left),.orchestra_right(mpi_orch_right), + .legacy_left(ssc_legacy_left),.legacy_right(ssc_legacy_right), + .cartridge_reset(ssc_cartridge_reset),.host_read(ssc_host_read),.host_write(ssc_host_write), + .host_address(ssc_host_address),.host_data(ssc_host_data), + .read_valid(ssc_read_valid),.read_data(ssc_read_data),.palette_owner(ssc_palette_owner), + .rom_files_valid(ssc_files_valid),.load_fault(SSC_FAULT), + .pic_begin(ssc_pic_begin),.pic_write(ssc_pic_write),.pic_address(ssc_pic_address),.pic_data(ssc_pic_data), + .speech_begin(ssc_speech_begin),.speech_write(ssc_speech_write),.speech_address(ssc_speech_address),.speech_data(ssc_speech_data), + .audio_left(SOUND_LEFT),.audio_right(SOUND_RIGHT)); +assign SSC_READY=mpi_ssc_present&&ssc_files_valid&&ssc_operational; +ssc_cartridge #(.CLOCK_HZ(57272727)) ssc( + .clk(clk_sys),.reset(SSC_POWER_RESET),.cartridge_reset(ssc_cartridge_reset),.enable(ssc_mode_active), + .host_read(ssc_host_read),.host_write(ssc_host_write),.host_address(ssc_host_address),.host_data(ssc_host_data), + .host_read_valid(ssc_chip_read_valid),.host_read_data(ssc_chip_read_data), + .status(ssc_status), + .pic_rom_begin(ssc_pic_begin),.pic_rom_write(ssc_pic_write),.pic_rom_address(ssc_pic_address),.pic_rom_data(ssc_pic_data), + .speech_rom_begin(ssc_speech_begin),.speech_rom_write(ssc_speech_write),.speech_rom_address(ssc_speech_address),.speech_rom_data(ssc_speech_data), + .pic_loaded(ssc_pic_loaded),.speech_loaded(ssc_speech_loaded),.operational(ssc_operational),.fault(ssc_chip_fault), + .audio_sample(ssc_audio),.audio_valid(ssc_audio_valid),.speech_standby(ssc_standby),.sound_activity(ssc_activity),.debug_pc(ssc_debug_pc)); // the DAC isn't really a DAC but represents the DAC chip on the schematic. @@ -3709,17 +3766,21 @@ assign KEYBOARD_IN[5] = !((!KEY_COLUMN[0] & KEY[40]) // 8 | (!KEY_COLUMN[6] & KEY[46]) // . | (!KEY_COLUMN[7] & KEY[47])); // / +// Research: phase-match the remaining CPU keyboard control flags. +reg [3:0] keyboard_cpu_controls = 4'b1000; +always @(negedge clk_sys) keyboard_cpu_controls <= {EE_N, MUGS, SHIFT, SHIFT_OVERRIDE}; + assign KEYBOARD_IN[6] = !((!KEY_COLUMN[0] & KEY[48]) // CR | (!KEY_COLUMN[1] & KEY[49]) // TAB | (!KEY_COLUMN[2] & KEY[50]) // ESC | (!KEY_COLUMN[3] & KEY[51]) // ALT - | (!KEY_COLUMN[3] & (!BUTTON_N[0] | MUGS)) // ALT (Easter Egg) + | (!KEY_COLUMN[3] & (!keyboard_cpu_controls[3] | keyboard_cpu_controls[2])) // ALT (Easter Egg) | (!KEY_COLUMN[4] & KEY[52]) // CTRL - | (!KEY_COLUMN[4] & (!BUTTON_N[0] | MUGS)) // CTRL (Easter Egg) + | (!KEY_COLUMN[4] & (!keyboard_cpu_controls[3] | keyboard_cpu_controls[2])) // CTRL (Easter Egg) | (!KEY_COLUMN[5] & KEY[53]) // F1 | (!KEY_COLUMN[6] & KEY[54]) // F2 - | (!KEY_COLUMN[7] & KEY[55] & !SHIFT_OVERRIDE) // shift - | (!KEY_COLUMN[7] & SHIFT)); // Forced Shift + | (!KEY_COLUMN[7] & KEY[55] & !keyboard_cpu_controls[0]) // shift + | (!KEY_COLUMN[7] & keyboard_cpu_controls[1])); // Forced Shift assign KEYBOARD_IN[7] = JSTICK; // Joystick input @@ -3730,20 +3791,22 @@ COCOKEY coco_keyboard( .SLO_CLK(V_SYNC_N), .PS2_CLK(ps2_clk), .PS2_DATA(ps2_data), - .KEY(KEY_RCVD), + .KEY(KEY_RAW), .SHIFT(SHIFT), .SHIFT_OVERRIDE(SHIFT_OVERRIDE), .RESET(RESET), .RESET_INS(RESET_INS) ); -wire [72:0] KEY_RCVD; +wire [72:0] KEY_RAW; +reg [72:0] KEY_RCVD = 73'd0; +always @(negedge clk_sys) KEY_RCVD <= KEY_RAW; Auto_Run CoCo3_Auto_Run( .RESET_N(RESET_N), .CLK(clk_sys), .CLK_1_78(clk_1_78), - .MPI_SCS(SWITCH[2:1]), + .MPI_SCS(MPI_LAYOUT[SWITCH[2:1]*3+:3]==3 ? 2'b01 : 2'b11), .MODE(AUTO_MODE), .AMW_ACK(AMW_ACK), .KEY_IN(KEY_RCVD), @@ -3776,12 +3839,12 @@ end // Borrowed from MAC PLUS wire ps2_x1, ps2_y1, ps2_x2, ps2_y2; -wire ps2_button; +wire ps2_button, ps2_button_raw; ps2_mouse coco_ps2_mouse( .clk(clk_sys), .ce(PH_2), - .reset(~RESET_N), + .reset(~RESET_POS_N), .ps2_mouse(ps2_mouse), @@ -3789,7 +3852,7 @@ ps2_mouse coco_ps2_mouse( .y1(ps2_y1), .x2(ps2_x2), .y2(ps2_y2), - .button(ps2_button) + .button(ps2_button_raw) ); // This code creates a virtual joystick based on mouse movements. @@ -3797,14 +3860,18 @@ ps2_mouse coco_ps2_mouse( // [note check of boundry before inc / dev] reg [7:0] mouse_x_pos, mouse_y_pos; -wire [15:0] mouse_xy_pos = {mouse_x_pos, mouse_y_pos}; +// Research: CPU-facing mouse sample, retaining the original position decoder. +reg [16:0] mouse_cpu_sample = 17'h18080; +always @(negedge clk_sys) mouse_cpu_sample <= {ps2_button_raw, mouse_x_pos, mouse_y_pos}; +wire [15:0] mouse_xy_pos = mouse_cpu_sample[15:0]; +assign ps2_button = mouse_cpu_sample[16]; reg [1:0] old_x, old_y; wire [1:0] x_mouse = {ps2_x1, ps2_x2}; wire [1:0] y_mouse = {ps2_y1, ps2_y2}; -always @ (posedge clk_sys or negedge RESET_N) +always @ (posedge clk_sys or negedge RESET_POS_N) begin - if(!RESET_N) + if(!RESET_POS_N) begin mouse_x_pos <= 8'h80; mouse_y_pos <= 8'h80; @@ -3962,8 +4029,8 @@ VDAC VDAC_inst ( // .rdclock ( PIX_CLK ), // KEY: 01/14/26 .wraddress ( DATA_OUT ), - .wrclock ( clk_sys ), - .wren ( VDAC_EN & PH_2 ), + .wrclock ( ~clk_sys ), + .wren ( VDAC_EN & PH_2 & ssc_palette_owner ), .q ( VDAC_OUT ) ); @@ -4190,14 +4257,20 @@ coco3_Char_ROM coco3_Char_ROM( ); +// Research: reset the UART enable generator with synchronous release. +(* preserve *) reg [1:0] uart_tick_release = 2'b00; +wire uart_tick_reset_n = uart_tick_release[1]; +always @(posedge clk_sys or negedge RESET_N) + if (!RESET_N) uart_tick_release <= 2'b00; + else uart_tick_release <= {uart_tick_release[0], 1'b1}; reg [4:0] CLK_6551; // Targeting 1.8432 Mhz. // 57.272727 Mhz / 31 = 1.8475 Mhz reg CLK_6551_EN; -always @(negedge clk_sys or negedge RESET_N) +always @(negedge clk_sys or negedge uart_tick_reset_n) begin - if(!RESET_N) + if(!uart_tick_reset_n) begin CLK_6551 <= 5'd0; CLK_6551_EN <= 1'b0; diff --git a/rtl/cpu_sdram_bridge.sv b/rtl/cpu_sdram_bridge.sv new file mode 100644 index 0000000..845a5b1 --- /dev/null +++ b/rtl/cpu_sdram_bridge.sv @@ -0,0 +1,31 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// Research request boundary for the MiSTer 57 MHz CPU / 114 MHz SDRAM interface. +// Captures the complete selected CPU/GART/AMW payload after the core raises req. +// The clocks are related PLL outputs; all crossings retain normal timing checks. +module cpu_sdram_bridge ( + input clk, fast_clk, reset, + input [24:0] cpu_addr, + input [7:0] cpu_din, + input cpu_req, cpu_rnw, memory_ack, + output cpu_ack, + output reg [24:0] memory_addr, + output reg [7:0] memory_din, + output reg memory_rnw, + output reg memory_req = 1'b0 +); +// A falling fast-clock observation avoids the coincident positive-fast / +// negative-system edge for ACK. Both half-period transfers remain timed. +reg ack_phase = 1'b0; +always @(negedge fast_clk) ack_phase <= reset ? 1'b0 : memory_ack; +assign cpu_ack = cpu_req && memory_req && ack_phase; +always @(negedge clk) begin + if (reset || !cpu_req) memory_req <= 1'b0; + else if (!memory_req && !ack_phase) begin + memory_addr <= cpu_addr; + memory_din <= cpu_din; + memory_rnw <= cpu_rnw; + memory_req <= 1'b1; + end +end +endmodule diff --git a/rtl/fdc.sv b/rtl/fdc.sv index 4aff17e..932d371 100644 --- a/rtl/fdc.sv +++ b/rtl/fdc.sv @@ -1,3 +1,5 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. //////////////////////////////////////////////////////////////////////////////// // Project Name: COCO3 Targeting MISTer // File Name: fdc.sv @@ -107,6 +109,12 @@ wire [5:0] div_8mhz; assign ena_8Mhz = (div_8mhz == 6'd5) ? 1'b1: 1'b0; +// Research: local positive-edge reset release for the WD1793 banks. +(* preserve *) reg [1:0] wd_reset_release = 2'b00; +always @(posedge CLK or negedge RESET_N) + if (!RESET_N) wd_reset_release <= 2'b00; + else wd_reset_release <= {wd_reset_release[0], 1'b1}; + always@(negedge CLK or negedge RESET_N) begin if (~RESET_N) div_8mhz <= 6'd0; @@ -393,52 +401,95 @@ reg [23:0] drive_size[4]; // Reset of drive wp to a default of 1 removed because of persistance. +// Research: mount strobes are data from hps_io, not clock sources. +reg [3:0] img_mounted_d = 0; +always @(posedge CLK) img_mounted_d <= img_mounted; + +reg [3:0] mount_pending = 0; +reg [3:0] mount_wp; +reg [3:0] mount_double_sided; +reg [23:0] mount_size[4]; +always @(posedge CLK) mount_pending <= img_mounted_d & ~img_mounted; + // Drive 0 -always @(negedge img_mounted[0]) +always @(posedge CLK) begin - drive_wp[0] <= img_readonly; - drive_ready[0] <= 1'b1; - drive_size[0] <= {4'h0, img_size[19:0]}; //Size / 256 on [19:8] - double_sided[0]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; + if (img_mounted_d[0] && !img_mounted[0]) + begin + mount_wp[0] <= img_readonly; + mount_size[0] <= {4'h0, img_size[19:0]}; //Size / 256 on [19:8] + mount_double_sided[0]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; + end end // Drive 1 -always @(negedge img_mounted[1]) +always @(posedge CLK) begin - drive_wp[1] <= img_readonly; - drive_ready[1] <= 1'b1; - drive_size[1] <= {4'h0, img_size[19:0]}; //Size / 256 on [19:8] - double_sided[1]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; + if (img_mounted_d[1] && !img_mounted[1]) + begin + mount_wp[1] <= img_readonly; + mount_size[1] <= {4'h0, img_size[19:0]}; //Size / 256 on [19:8] + mount_double_sided[1]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; + end end // Drive 2 -always @(negedge img_mounted[2]) +always @(posedge CLK) begin - drive_wp[2] <= img_readonly; - drive_ready[2] <= 1'b1; - drive_size[2] <= {4'h0, img_size[19:0]}; //Size / 256 on [19:8] - double_sided[2]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; + if (img_mounted_d[2] && !img_mounted[2]) + begin + mount_wp[2] <= img_readonly; + mount_size[2] <= {4'h0, img_size[19:0]}; //Size / 256 on [19:8] + mount_double_sided[2]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; + end end // Drive 3 -always @(negedge img_mounted[3]) +always @(posedge CLK) begin - drive_wp[3] <= img_readonly; - drive_ready[3] <= 1'b1; - drive_size[3] <= {4'h0, img_size[19:0]}; //Size / 256 on [19:8] - //double_sided[3]<= img_size > 20'd368600;//20'd368640; + if (img_mounted_d[3] && !img_mounted[3]) + begin + mount_wp[3] <= img_readonly; + mount_size[3] <= {4'h0, img_size[19:0]}; //Size / 256 on [19:8] + //mount_double_sided[3]<= img_size > 20'd368600;//20'd368640; + end end +// Research: commit metadata on consumer's falling phase after classification. +always @(negedge CLK) if (mount_pending[0]) begin + drive_wp[0] <= mount_wp[0]; + drive_ready[0] <= 1'b1; + drive_size[0] <= mount_size[0]; + double_sided[0] <= mount_double_sided[0]; +end +always @(negedge CLK) if (mount_pending[1]) begin + drive_wp[1] <= mount_wp[1]; + drive_ready[1] <= 1'b1; + drive_size[1] <= mount_size[1]; + double_sided[1] <= mount_double_sided[1]; +end +always @(negedge CLK) if (mount_pending[2]) begin + drive_wp[2] <= mount_wp[2]; + drive_ready[2] <= 1'b1; + drive_size[2] <= mount_size[2]; + double_sided[2] <= mount_double_sided[2]; +end +always @(negedge CLK) if (mount_pending[3]) begin + drive_wp[3] <= mount_wp[3]; + drive_ready[3] <= 1'b1; + drive_size[3] <= mount_size[3]; +end + wd1793 #(1,0) coco_wd1793_0 ( .clk_sys(~CLK), .ce(ena_8Mhz), - .reset(~RESET_N), + .reset(~wd_reset_release[1]), .io_en(1'b1), .rd(RD[0]), .wr(WR[0]), @@ -480,7 +531,7 @@ wd1793 #(1,0) coco_wd1793_1 ( .clk_sys(~CLK), .ce(ena_8Mhz), - .reset(~RESET_N), + .reset(~wd_reset_release[1]), .io_en(1'b1), .rd(RD[1]), .wr(WR[1]), @@ -522,7 +573,7 @@ wd1793 #(1,0) coco_wd1793_2 ( .clk_sys(~CLK), .ce(ena_8Mhz), - .reset(~RESET_N), + .reset(~wd_reset_release[1]), .io_en(1'b1), .rd(RD[2]), .wr(WR[2]), @@ -564,7 +615,7 @@ wd1793 #(1,0) coco_wd1793_3 ( .clk_sys(~CLK), .ce(ena_8Mhz), - .reset(~RESET_N), + .reset(~wd_reset_release[1]), .io_en(1'b1), .rd(RD[3]), .wr(WR[3]), diff --git a/rtl/mc6809glb/mc6809glb.v b/rtl/mc6809glb/mc6809glb.v index 9627ab4..ee17476 100644 --- a/rtl/mc6809glb/mc6809glb.v +++ b/rtl/mc6809glb/mc6809glb.v @@ -1,3 +1,5 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. `timescale 1ns / 1ns ////////////////////////////////////////////////////////////////////////////////// // Company: @@ -191,14 +193,14 @@ reg [15:0] ea_p1; // NMI is supposed to be masked - despite the name - until the 6809 loads a value into S. // Frankly, I'm cheating slightly. If someone does a LDS #$0, it won't disable the mask. Pretty much anything else // that changes the value of S from the default (which is currently $0) will clear the mask. A reset will set the mask again. -reg NMIMask; +(* keep *) wire NMIMask; -reg NMILatched; +(* keep *) wire NMILatched; +reg rnRESET=0; // The latched version of /RESET, useful 1 clock after it's latched reg NMISample; reg NMISample2; reg NMIClear; reg NMIClear_nxt; -wire wNMIClear = NMIClear; reg IRQLatched; @@ -534,14 +536,52 @@ endgenerate /////////////////////////////////////////////////////////////////////// -always @(negedge NMISample2 or posedge wNMIClear) +// Research: registered observations replace event clocks and next-S logic. +// S and its prior master-cycle value expose the actual CPU register update, +// avoiding the long instruction/ALU -> s_nxt comparator in the NMI mask path. +reg [15:0] NMIStackPrevious; +reg NMIMaskStored = 1'b1; +reg NMIEdge = 1'b0; +reg NMIPending = 1'b0; +function NMIStackDiff; + input [15:0] previous_value, current_value; + begin + NMIStackDiff = 1'b0; + if (previous_value != current_value) NMIStackDiff = 1'b1; + end +endfunction +wire NMIStackChanged = NMIStackDiff(NMIStackPrevious, s); +assign NMIMask = NMIMaskStored && !NMIStackChanged; +reg NMIQualifiedEdge; +always @* begin + NMIQualifiedEdge = 1'b0; + if (NMIEdge) + if (NMIClear == 1'b1) NMIQualifiedEdge = 1'b0; + else if (NMIMask == 1'b0) NMIQualifiedEdge = 1'b1; +end +// The same-event view uses new registered mask/clear values after NBA updates. +// Pending state retains that view on the next master edge; CPU-visible timing +// therefore has no extra E-cycle, including back-to-back CPU enables. +reg NMIVisible; +always @* begin + NMIVisible = 1'b1; + if (NMIClear == 1'b1) NMIVisible = 1'b1; + else if (NMIPending || NMIQualifiedEdge) NMIVisible = 1'b0; +end +assign NMILatched = NMIVisible; +always @(negedge MASTER) begin - if (wNMIClear == 1) - NMILatched <= 1; - else if (NMIMask == 0) - NMILatched <= 0; - else - NMILatched <= 1; + NMIStackPrevious <= s; + if (!nRESET || !rnRESET) begin + NMIMaskStored <= 1'b1; + NMIEdge <= 1'b0; + NMIPending <= 1'b0; + end else begin + NMIEdge <= E && NMISample2 && !NMISample; + if (NMIStackChanged) NMIMaskStored <= 1'b0; + if (NMIClear == 1'b1) NMIPending <= 1'b0; + else if (NMIQualifiedEdge) NMIPending <= 1'b1; + end end // @@ -579,7 +619,6 @@ begin end end -reg rnRESET=0; // The latched version of /RESET, useful 1 clock after it's latched always @(negedge MASTER) begin if (E) @@ -635,13 +674,11 @@ begin IntType <= IntType_nxt; - if (s != s_nxt) // Once S changes at all (default is '0'), release the NMI Mask. - NMIMask <= 1'b0; + end else begin CpuState <= CPUSTATE_RESET; - NMIMask <= 1'b1; // Mask NMI until S is loaded. NMIClear <= 1'b0; // Mark us as not having serviced NMI end end diff --git a/rtl/sdc.sv b/rtl/sdc.sv index 4335f54..13576c8 100644 --- a/rtl/sdc.sv +++ b/rtl/sdc.sv @@ -1,3 +1,5 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. //////////////////////////////////////////////////////////////////////////////// // Project Name: COCO3 Targeting MISTer // File Name: sdc.sv @@ -505,7 +507,8 @@ always_ff@(posedge clock) begin end end -always_ff@(posedge clock) begin +// CPU port shares the CPU-consuming edge; host port A stays positive. +always_ff@(negedge clock) begin if(wren_b) begin ram[address_b] <= data_b; q_b <= data_b; diff --git a/rtl/sdc_top.sv b/rtl/sdc_top.sv index b9c9d46..7107823 100644 --- a/rtl/sdc_top.sv +++ b/rtl/sdc_top.sv @@ -1,3 +1,5 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. //////////////////////////////////////////////////////////////////////////////// // Project Name: COCO3 Targeting MISTer // File Name: sdc_top.sv @@ -115,6 +117,12 @@ wire [5:0] div_8mhz; assign ena_8Mhz = (div_8mhz == 6'd5) ? 1'b1: 1'b0; +// Research: local positive-edge reset release for the WD1793 banks. +(* preserve *) reg [1:0] wd_reset_release = 2'b00; +always @(posedge CLK or negedge RESET_N) + if (!RESET_N) wd_reset_release <= 2'b00; + else wd_reset_release <= {wd_reset_release[0], 1'b1}; + always@(negedge CLK or negedge RESET_N) begin if (~RESET_N) div_8mhz <= 6'd0; @@ -443,32 +451,60 @@ reg [31:0] drive_size[2]; // Reset of drive wp to a default of 1 removed because of persistance. +// Research: mount strobes are data from hps_io, not clock sources. +reg [1:0] img_mounted_d = 0; +always @(posedge CLK) img_mounted_d <= img_mounted; + +reg [1:0] mount_pending = 0; +reg [1:0] mount_wp; +reg [1:0] mount_double_sided; +reg [31:0] mount_size[2]; +always @(posedge CLK) mount_pending <= img_mounted_d & ~img_mounted; + // Drive 0 -always @(negedge img_mounted[0]) +always @(posedge CLK) begin - drive_wp[0] <= img_readonly; - drive_ready[0] <= 1'b1; - drive_size[0] <= img_size[31:0]; //Size / 256 on [31:8] - double_sided[0]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; + if (img_mounted_d[0] && !img_mounted[0]) + begin + mount_wp[0] <= img_readonly; + mount_size[0] <= img_size[31:0]; //Size / 256 on [31:8] + mount_double_sided[0]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; + end end // Drive 1 -always @(negedge img_mounted[1]) +always @(posedge CLK) begin - drive_wp[1] <= img_readonly; - drive_ready[1] <= 1'b1; - drive_size[1] <= img_size[31:0]; //Size / 256 on [31:8] - double_sided[1]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; + if (img_mounted_d[1] && !img_mounted[1]) + begin + mount_wp[1] <= img_readonly; + mount_size[1] <= img_size[31:0]; //Size / 256 on [31:8] + mount_double_sided[1]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; + end end +// Research: commit metadata on consumer's falling phase after classification. +always @(negedge CLK) if (mount_pending[0]) begin + drive_wp[0] <= mount_wp[0]; + drive_ready[0] <= 1'b1; + drive_size[0] <= mount_size[0]; + double_sided[0] <= mount_double_sided[0]; +end +always @(negedge CLK) if (mount_pending[1]) begin + drive_wp[1] <= mount_wp[1]; + drive_ready[1] <= 1'b1; + drive_size[1] <= mount_size[1]; + double_sided[1] <= mount_double_sided[1]; +end + wd1793 #(1,0) coco_wd1793_sdc_0 ( .clk_sys(~CLK), .ce(ena_8Mhz), - .reset(~RESET_N), + .reset(~wd_reset_release[1]), .io_en(1'b1), .rd(RD[0]), .wr(WR[0]), @@ -510,7 +546,7 @@ wd1793 #(1,0) coco_wd1793_sdc_1 ( .clk_sys(~CLK), .ce(ena_8Mhz), - .reset(~RESET_N), + .reset(~wd_reset_release[1]), .io_en(1'b1), .rd(RD[1]), .wr(WR[1]), diff --git a/rtl/sdram/sdram2.sv b/rtl/sdram/sdram2.sv index bb358c5..f9df642 100644 --- a/rtl/sdram/sdram2.sv +++ b/rtl/sdram/sdram2.sv @@ -1,3 +1,5 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. // // sdram // Copyright (c) 2015-2019 Sorgelig @@ -81,10 +83,14 @@ localparam OP_MODE = 2'b00; // only 00 (standard operation) allow localparam NO_WRITE_BURST = 1'b1; // 0= write burst enabled, 1=only single access write localparam MODE = {3'b000, NO_WRITE_BURST, OP_MODE, CAS_LATENCY, ACCESS_TYPE, BURST_CODE}; -localparam sdram_startup_cycles= 14'd12100;// 100us, plus a little more, @ 100MHz -localparam startup_refresh_max = 14'b11111111111111; +// AS4C32M16SB requires 200 us with stable inputs before initialization. +// 25,000 cycles at 114.545454 MHz leaves >218 us, including command spacing. +localparam sdram_startup_cycles= 15'd25000; +localparam startup_refresh_max = 15'h7fff; //localparam cycles_per_refresh = 14'd780; // (64000*100)/8192-1 Calc'd as (64ms @ 100MHz)/8192 rose -localparam cycles_per_refresh = 14'd890; // (64000*100)/8192-1 Calc'd as (64ms @ 114.560MHz)/8192 rose (act 895) +// Reserve the bounded command/recovery latency before the 894.9-cycle limit +// (64 ms / 8192 at 114.545454 MHz). Do not wait for twice this interval. +localparam cycles_per_refresh = 14'd880; // SDRAM commands wire [2:0] CMD_NOP = 3'b111; @@ -95,7 +101,7 @@ wire [2:0] CMD_PRECHARGE = 3'b010; wire [2:0] CMD_AUTO_REFRESH = 3'b001; wire [2:0] CMD_LOAD_MODE = 3'b000; -reg [13:0] refresh_count = startup_refresh_max - sdram_startup_cycles; +reg [14:0] refresh_count = startup_refresh_max - sdram_startup_cycles; reg [2:0] command; localparam STATE_STARTUP = 0; @@ -105,6 +111,7 @@ localparam STATE_RW1 = 3; localparam STATE_IDLE = 4; localparam STATE_DLY1 = 5; localparam STATE_DLY2 = 6; +localparam STATE_DLY3 = 20; localparam STATE_IDLE_7 = 17; localparam STATE_IDLE_6 = 16; localparam STATE_IDLE_5 = 15; @@ -114,10 +121,32 @@ localparam STATE_IDLE_2 = 12; localparam STATE_IDLE_1 = 11; reg [15:0] dq_reg; +// CL3's output launches on the preceding edge (READ T4 -> launch T6, +// receive T7). Preserve the original READY alignment: adding another cycle +// selects burst beat two. Pin setup/hold remains checked in external-io.sdc. +localparam READ_CAPTURE_EXTRA = 0; + +// Research: CPU-only activation stage. Request arbitration controls state, +// while payload snapshots isolate the external bus from the output mux tree. +reg [24:0] cpu_address_snapshot; +reg [7:0] cpu_data_snapshot; +reg cpu_rnw_snapshot; +localparam STATE_CPU_ACTIVE = 18; +// Research: keep video address arithmetic out of the SDRAM output mux. +// The next state consumes the snapshot from the arbitration edge, adding one +// fast clock before ACTIVE. No address/command is issued from an invalid sample. +reg [24:0] video_address_snapshot; +localparam STATE_VIDEO_ACTIVE = 19; +always @(posedge clk) video_address_snapshot <= sdram_vid_addr; +always @(posedge clk) begin + cpu_address_snapshot <= sdram_cpu_addr; + cpu_data_snapshot <= sdram_cpu_din; + cpu_rnw_snapshot <= sdram_cpu_rnw; +end always @(posedge clk) begin - reg [CAS_LATENCY+BURST_LENGTH:0] data_cpu_ready_delay; - reg [CAS_LATENCY+BURST_LENGTH:0] data_vid_ready_delay; + reg [CAS_LATENCY+BURST_LENGTH+READ_CAPTURE_EXTRA:0] data_cpu_ready_delay; + reg [CAS_LATENCY+BURST_LENGTH+READ_CAPTURE_EXTRA:0] data_vid_ready_delay; reg saved_wr; reg saved_vid; @@ -127,9 +156,9 @@ always @(posedge clk) begin refresh_count <= refresh_count + 1'b1; - data_vid_ready_delay[CAS_LATENCY+BURST_LENGTH] <= 0; + data_vid_ready_delay[CAS_LATENCY+BURST_LENGTH+READ_CAPTURE_EXTRA] <= 0; - data_cpu_ready_delay[CAS_LATENCY+BURST_LENGTH] <= 0; + data_cpu_ready_delay[CAS_LATENCY+BURST_LENGTH+READ_CAPTURE_EXTRA] <= 0; data_cpu_ready_delay <= data_cpu_ready_delay>>1; data_vid_ready_delay <= data_vid_ready_delay>>1; @@ -206,7 +235,7 @@ always @(posedge clk) begin state <= STATE_IDLE; sdram_busy <= 1'b0; // mask possible refresh to reduce colliding. - if(refresh_count > cycles_per_refresh) begin + if(refresh_count >= cycles_per_refresh) begin state <= STATE_IDLE_7; command <= CMD_AUTO_REFRESH; refresh_count <= 0; @@ -216,47 +245,53 @@ always @(posedge clk) begin STATE_IDLE: begin saved_vid <= 1'b0; - if(refresh_count > (cycles_per_refresh<<1)) + if(refresh_count >= cycles_per_refresh) begin state <= STATE_IDLE_1; sdram_busy <= 1'b1; end else begin - if(sdram_cpu_req & !sdram_cpu_ack) // request has to go away after ready=0 - begin -// fix byte writes [no new command until data is actually written] - if (~sdram_cpu_rnw) - {cas_addr[12:9],SDRAM_BA,SDRAM_A,cas_addr[8:0]} <= {~sdram_cpu_addr[0], sdram_cpu_addr[0], 2'b10, sdram_cpu_addr[24:1]}; // Bytes by A0 for writes - else - {cas_addr[12:9],SDRAM_BA,SDRAM_A,cas_addr[8:0]} <= {2'b00, 2'b10, sdram_cpu_addr[24:1]}; // No bytes for reads... - - saved_data <= {sdram_cpu_din, sdram_cpu_din}; - saved_wr <= ~sdram_cpu_rnw; - command <= CMD_ACTIVE; - state <= STATE_WAIT; - sdram_busy <= 1'b1; - end + if(sdram_cpu_req & !sdram_cpu_ack) + begin + state <= STATE_CPU_ACTIVE; + sdram_busy <= 1'b1; + end else begin if (sdram_vid_req) begin - {cas_addr[12:9],SDRAM_BA,SDRAM_A,cas_addr[8:0]} <= {2'b00, 2'b10, sdram_vid_addr[24:1]}; // No bytes for reads... - command <= CMD_ACTIVE; + state <= STATE_VIDEO_ACTIVE; saved_vid <= 1'b1; saved_wr <= 1'b0; sdram_busy <= 1'b1; - state <= STATE_WAIT; end end end end + STATE_VIDEO_ACTIVE: begin + {cas_addr[12:9],SDRAM_BA,SDRAM_A,cas_addr[8:0]} <= {2'b00, 2'b10, video_address_snapshot[24:1]}; + command <= CMD_ACTIVE; + state <= STATE_WAIT; + end + + STATE_CPU_ACTIVE: begin + if (~cpu_rnw_snapshot) + {cas_addr[12:9],SDRAM_BA,SDRAM_A,cas_addr[8:0]} <= {~cpu_address_snapshot[0], cpu_address_snapshot[0], 2'b10, cpu_address_snapshot[24:1]}; + else + {cas_addr[12:9],SDRAM_BA,SDRAM_A,cas_addr[8:0]} <= {2'b00, 2'b10, cpu_address_snapshot[24:1]}; + saved_data <= {cpu_data_snapshot, cpu_data_snapshot}; + saved_wr <= ~cpu_rnw_snapshot; + command <= CMD_ACTIVE; + state <= STATE_WAIT; + end + STATE_WAIT: state <= STATE_WAIT1; STATE_WAIT1: begin if (saved_wr) begin - if ((data_vid_ready_delay[5:1] == 5'b00000) && (data_cpu_ready_delay[5:1] == 5'b00000)) + if ((data_vid_ready_delay[CAS_LATENCY+BURST_LENGTH+READ_CAPTURE_EXTRA:1] == '0) && (data_cpu_ready_delay[CAS_LATENCY+BURST_LENGTH+READ_CAPTURE_EXTRA:1] == '0)) state <= STATE_RW1; // added for clk > 100Mhz end else @@ -283,17 +318,20 @@ always @(posedge clk) begin state <= STATE_IDLE; if (saved_vid) begin - data_vid_ready_delay[CAS_LATENCY+BURST_LENGTH] <= 1; + data_vid_ready_delay[CAS_LATENCY+BURST_LENGTH+READ_CAPTURE_EXTRA] <= 1; state <= STATE_DLY1; end else - data_cpu_ready_delay[CAS_LATENCY+BURST_LENGTH] <= 1; + data_cpu_ready_delay[CAS_LATENCY+BURST_LENGTH+READ_CAPTURE_EXTRA] <= 1; state <= STATE_DLY1; end end STATE_DLY1: state <= STATE_DLY2; STATE_DLY2: + state <= STATE_DLY3; + STATE_DLY3: + // Eight clocks between legal back-to-back ACTIVEs, >=63 ns tRC. state <= STATE_IDLE; endcase diff --git a/rtl/ssc/LICENSE b/rtl/ssc/LICENSE new file mode 100644 index 0000000..0994231 --- /dev/null +++ b/rtl/ssc/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +SSC wiring and SP0256/TMS7000 portions are derived from MAME: +Copyright holders: Tim Lindner, Joseph Zbiciak, hap. +See the individual source headers for component provenance. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/rtl/ssc/ssc_audio.sv b/rtl/ssc/ssc_audio.sv new file mode 100644 index 0000000..682e343 --- /dev/null +++ b/rtl/ssc/ssc_audio.sv @@ -0,0 +1,91 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Cartridge mix and digital SAC model, based on VCCPlus/MAME Tim Lindner. +// audio_ce must be44100Hz: the reference RC coefficients are per audio sample. +// Q16 PCM states and Q24 coefficients approximate the software float circuit. +// This is a digital reference model, not a measured analog transfer function. +module ssc_audio(input wire clk,reset,audio_ce,input wire [17:0] ay_sum, + input wire signed [15:0] speech_sample,output reg signed [15:0] mixed_sample, + output reg sample_valid,activity,overrun,output wire busy); +localparam [3:0] IDLE=0,MIX=1,HP_PREP=2,HP_MULT=3,HP_STORE=4, + ENV_PREP=5,ENV_MULT=6,ENV_STORE=7,AVERAGE=8,MULT_COMBINE=9; +reg [3:0] state; +assign busy=state!=IDLE; +reg [15:0] ay_average; +reg [17:0] divide_shift,quotient; +reg [1:0] remainder; +reg [4:0] divide_count; +wire [2:0] division_step={remainder,divide_shift[17]}; +wire [2:0] next_remainder=division_step>=3 ? division_step-3'd3 : division_step; +reg signed [15:0] speech_hold; +reg signed [20:0] mix_quarters; +reg signed [34:0] previous_input,previous_hp,rectified,operand; +reg [34:0] envelope; +reg [23:0] factor; +reg signed [59:0] product; +reg [41:0] product_low; +reg signed [41:0] product_high; +reg [3:0] combine_return; +wire signed [41:0] combined_high=product_high+$signed({18'd0,product_low[41:18]}); +wire signed [39:0] scaled_product=product>>>24; +wire signed [39:0] envelope_next=$signed({1'b0,envelope})+scaled_product; +wire signed [34:0] current_input=$signed({3'd0,ay_average,16'd0}); +wire signed [20:0] speech_extended={{5{speech_hold[15]}},speech_hold}; +always @(posedge clk)begin + if(reset)begin + state<=IDLE;ay_average<=0;speech_hold<=0;mix_quarters<=0; + divide_shift<=0;quotient<=0;remainder<=0;divide_count<=0; + previous_input<=0;previous_hp<=0;rectified<=0;operand<=0;envelope<=0; + factor<=0;product<=0;product_low<=0;product_high<=0;combine_return<=IDLE; + mixed_sample<=0;sample_valid<=0;activity<=0;overrun<=0; + end else begin + sample_valid<=0; + if(audio_ce&&busy)overrun<=1; + case(state) + IDLE:if(audio_ce)begin + divide_shift<=ay_sum;quotient<=0;remainder<=0;divide_count<=18; + speech_hold<=speech_sample;state<=AVERAGE; + end + AVERAGE:begin + remainder<=next_remainder[1:0]; + quotient<={quotient[16:0],division_step>=3};divide_shift<=divide_shift<<1; + divide_count<=divide_count-5'd1; + if(divide_count==1)begin ay_average<={quotient[14:0],division_step>=3};state<=MIX;end + end + MIX:begin + mix_quarters<=$signed({2'd0,ay_average,3'd0})+(speech_extended<<<3)-speech_extended; + state<=HP_PREP; + end + HP_PREP:begin + operand<=previous_hp+current_input-previous_input;factor<=24'd16609444; + state<=HP_MULT; + end + HP_MULT,ENV_MULT:begin + product_low<=operand[17:0]*factor; + product_high<=$signed(operand[34:18])*$signed({1'b0,factor}); + combine_return<=state==HP_MULT?HP_STORE:ENV_STORE;state<=MULT_COMBINE; + end + MULT_COMBINE:begin product<={combined_high,product_low[17:0]};state<=combine_return;end + HP_STORE:begin + previous_input<=current_input;previous_hp<=scaled_product[34:0]; + rectified<=scaled_product[39]?-scaled_product[34:0]:scaled_product[34:0];state<=ENV_PREP; + end + ENV_PREP:begin + operand<=rectified-$signed(envelope); + factor<=rectified>$signed(envelope)?24'd43621:24'd5033;state<=ENV_MULT; + end + ENV_STORE:begin + envelope<=envelope_next[34:0]; + if(activity&&envelope_next<40'sd21474836)activity<=0; + else if(!activity&&envelope_next>40'sd107374182)activity<=1; + if(mix_quarters>21'sd131068)mixed_sample<=16'sd32767; + else if(mix_quarters< -21'sd131072)mixed_sample<=16'sh8000; + else mixed_sample<=mix_quarters[17:2]; + sample_valid<=1;state<=IDLE; + end + default:state<=IDLE; + endcase + end +end +endmodule diff --git a/rtl/ssc/ssc_ay8913.sv b/rtl/ssc/ssc_ay8913.sv new file mode 100644 index 0000000..74e5c6b --- /dev/null +++ b/rtl/ssc/ssc_ay8913.sv @@ -0,0 +1,106 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// AY-3-8913 behavioral hardware port for Coco 3 Plus. +// Reference: VCCPlus a8a84f22 src/devices/ssc/ay8913.{h,cpp}; see LICENSE. +// The reference volume table is a logarithmic approximation, not silicon data. +// clock_enable pulses once per AY INPUT clock; internal generators divide by 8. +// Same-edge register writes follow generator advancement using old registers. +// sample_sum is the unnormalized three-channel sum, with two pipeline stages. +// The future SSC mixer applies /3 normalization, gain, filtering and routing. +module ssc_ay8913( + input wire clk,reset,clock_enable, + input wire reg_select,reg_write, + input wire [7:0] bus_data, + output wire [7:0] read_data, + output reg [17:0] sample_sum +); +reg [7:0] registers[0:15]; +reg [3:0] selected; +reg [2:0] divider; +reg [11:0] tone_counter[0:2]; +reg [2:0] tone_output; +reg [4:0] noise_counter; +reg [16:0] noise_lfsr; +reg [15:0] env_counter; +reg [5:0] env_step; +reg env_up,env_holding; +reg [15:0] level[0:2]; +wire [11:0] tone_period[0:2]; +wire [4:0] noise_period=registers[6][4:0]; +wire [15:0] env_period={registers[12],registers[11]}; +wire [4:0] env_position=env_up?env_step[4:0]:~env_step[4:0]; +wire [3:0] env_level=(!registers[13][3] && env_holding)?4'd0:env_position[4:1]; +assign read_data=registers[selected]; + +function [15:0] volume(input [3:0] index); + begin + case(index) + 0:volume=0;1:volume=1304;2:volume=1642;3:volume=2067; + 4:volume=2603;5:volume=3277;6:volume=4125;7:volume=5193; + 8:volume=6538;9:volume=8231;10:volume=10362;11:volume=13045; + 12:volume=16422;13:volume=20675;14:volume=26028;15:volume=32767; + endcase + end +endfunction +genvar ch; +generate for(ch=0;ch<3;ch=ch+1) begin:channels + assign tone_period[ch]={registers[ch*2+1][3:0],registers[ch*2]}; + wire gate=(registers[7][ch] || tone_output[ch]) && + (registers[7][ch+3] || noise_lfsr[0]); + wire [3:0] amplitude=registers[ch+8][4]?env_level:registers[ch+8][3:0]; + always @(posedge clk) begin + if(reset) level[ch]<=0; + else level[ch]<=gate?volume(amplitude):16'd0; + end +end endgenerate +integer i; +always @(posedge clk) begin + if(reset) begin + selected<=0;divider<=0;tone_output<=3'b111; + noise_counter<=0;noise_lfsr<=17'd1; + env_counter<=0;env_step<=0;env_up<=1;env_holding<=0; + sample_sum<=0; + for(i=0;i<16;i=i+1) registers[i]<=0; + for(i=0;i<3;i=i+1) tone_counter[i]<=0; + end else begin + sample_sum<={2'b0,level[0]}+{2'b0,level[1]}+{2'b0,level[2]}; + if(clock_enable) begin + divider<=divider+1'b1; + if(divider==3'd7) begin + for(i=0;i<3;i=i+1) begin + if(tone_counter[i]>=(tone_period[i]==0?12'd0:tone_period[i]-12'd1)) begin + tone_counter[i]<=0;tone_output[i]<=!tone_output[i]; + end else tone_counter[i]<=tone_counter[i]+1'b1; + end + if(noise_counter>=(noise_period==0?5'd0:noise_period-5'd1)) begin + noise_counter<=0; + noise_lfsr<={noise_lfsr[0]^noise_lfsr[3],noise_lfsr[16:1]}; + end else noise_counter<=noise_counter+1'b1; + if(env_counter>=(env_period==0?16'd0:env_period-16'd1)) begin + env_counter<=0; + if(!env_holding) begin + if(env_step==6'd31) begin + if(!registers[13][3]) begin env_step<=32;env_holding<=1;end + else if(registers[13][0]) begin + env_step<=31;env_holding<=1; + if(registers[13][1]) env_up<=!env_up; + end else begin + env_step<=0; + if(registers[13][1]) env_up<=!env_up; + end + end else env_step<=env_step+1'b1; + end + end else env_counter<=env_counter+1'b1; + end + end + if(reg_select) selected<=bus_data[3:0]; + if(reg_write) begin + registers[selected]<=bus_data; + if(selected==4'd13) begin + env_step<=0;env_holding<=0;env_up<=bus_data[2]; + end + end + end +end +endmodule diff --git a/rtl/ssc/ssc_cartridge.sv b/rtl/ssc/ssc_cartridge.sv new file mode 100644 index 0000000..7810a06 --- /dev/null +++ b/rtl/ssc/ssc_cartridge.sv @@ -0,0 +1,74 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Shared digital SSC cartridge; clocks use enables, never generated fabric clocks. +// reset is FPGA power/reconfiguration reset (clears volatile ROM loader state). +// cartridge_reset restarts chips while retaining loaded ROMs and glue SRAM. +module ssc_cartridge #(parameter integer CLOCK_HZ=114545408)( + input wire clk,reset,cartridge_reset,enable,host_read,host_write, + input wire [15:0] host_address,input wire [7:0] host_data, + output wire host_read_valid,output wire [7:0] host_read_data,output wire [7:0] status, + input wire pic_rom_begin,pic_rom_write,input wire [11:0] pic_rom_address,input wire [7:0] pic_rom_data, + input wire speech_rom_begin,speech_rom_write,input wire [10:0] speech_rom_address,input wire [7:0] speech_rom_data, + output wire pic_loaded,speech_loaded,operational,fault, + output wire signed [15:0] audio_sample,output wire audio_valid, + output wire speech_standby,sound_activity,output wire [15:0] debug_pc); +reg [31:0] ay_phase,speech_phase,audio_phase; +reg ay_ce,phi_ce,speech_ce,audio_ce,phi_half; +wire [32:0] ay_next={1'b0,ay_phase}+33'd1789772; +wire [32:0] speech_next={1'b0,speech_phase}+33'd10000; +wire [32:0] audio_next={1'b0,audio_phase}+33'd44100; +wire [32:0] ay_wrapped=ay_next>=CLOCK_HZ?ay_next-CLOCK_HZ:ay_next; +wire [32:0] speech_wrapped=speech_next>=CLOCK_HZ?speech_next-CLOCK_HZ:speech_next; +wire [32:0] audio_wrapped=audio_next>=CLOCK_HZ?audio_next-CLOCK_HZ:audio_next; +always @(posedge clk)begin + if(reset)begin + ay_phase<=0;speech_phase<=0;audio_phase<=0;ay_ce<=0;phi_ce<=0;speech_ce<=0;audio_ce<=0;phi_half<=0; + end else begin + ay_ce<=ay_next>=CLOCK_HZ;phi_ce<=0;speech_ce<=speech_next>=CLOCK_HZ;audio_ce<=audio_next>=CLOCK_HZ; + ay_phase<=ay_wrapped[31:0];speech_phase<=speech_wrapped[31:0];audio_phase<=audio_wrapped[31:0]; + if(ay_next>=CLOCK_HZ)begin phi_half<=!phi_half;phi_ce<=phi_half;end + end +end +wire pic_error,speech_error,pic_initialized,glue_initialized; +wire pic_overrun,speech_overrun,speech_fault,audio_overrun; +wire [31:0] illegal; +wire [7:0] command,host_result; +wire ignored_valid,command_read,busy_line,command_irq,command_busy,controller_reset,speech_reset; +wire gpio_request,gpio_write,gpio_ready; +wire [1:0] gpio_port; +wire [7:0] gpio_write_data,gpio_read_data,ay_bus,ay_read_data; +wire ay_select,ay_write,ald,speech_ready; +wire [5:0] allophone; +wire [17:0] ay_sum; +wire signed [15:0] speech_sample; +wire speech_valid,speech_busy,audio_busy; +wire [18:0] speech_pc; +wire [31:0] speech_frames; +wire rom_ready=pic_loaded&&speech_loaded; +assign fault=pic_error||speech_error||pic_overrun||speech_overrun||speech_fault||audio_overrun||(|illegal); +assign operational=rom_ready&&pic_initialized&&glue_initialized&&!fault; +// Address-independent status lets the wrapper sample at the CPU clock edge +// without feeding live CPU address/control back through the cartridge. +assign status=operational ? {!command_busy,speech_standby,!sound_activity,5'b11111} : 8'h7f; +assign host_read_valid=enable&&host_read&&(host_address==16'hff7d||host_address==16'hff7e); +assign host_read_data=!host_read_valid ? 8'd0 : host_address==16'hff7d ? 8'hff : operational ? host_result : 8'h7f; +ssc_host host(clk,reset||!rom_ready,enable&&operational,host_read,host_write,host_address,host_data, + ignored_valid,host_result,command_read,busy_line,command,command_irq,command_busy, + speech_standby,sound_activity,controller_reset,speech_reset); +ssc_tms7000 controller(.clk(clk),.reset(reset),.controller_reset(controller_reset||cartridge_reset), + .icount_tick(phi_ce),.rom_begin(pic_rom_begin),.rom_write(pic_rom_write),.rom_address(pic_rom_address),.rom_data(pic_rom_data), + .rom_loaded(pic_loaded),.load_error(pic_error),.initialized(pic_initialized),.overrun(pic_overrun), + .debug_pc(debug_pc),.illegal_count(illegal),.irq1(speech_ready),.irq3(command_irq),.timer_external(command[7]), + .gpio_request(gpio_request),.gpio_write(gpio_write),.gpio_port(gpio_port),.gpio_write_data(gpio_write_data), + .gpio_ready(gpio_ready),.gpio_read_data(gpio_read_data)); +ssc_glue glue(clk,reset,gpio_request,gpio_write,gpio_port,gpio_write_data,gpio_ready,gpio_read_data, + glue_initialized,command,command_read,busy_line,ay_select,ay_write,ay_bus,ay_read_data,ald,allophone); +ssc_ay8913 ay(clk,reset||controller_reset||cartridge_reset,ay_ce,ay_select,ay_write,ay_bus,ay_read_data,ay_sum); +ssc_sp0256 speech(.clk(clk),.reset(reset),.speech_reset(speech_reset||cartridge_reset),.sample_ce(speech_ce), + .ald(ald),.allophone(allophone),.rom_begin(speech_rom_begin),.rom_write(speech_rom_write), + .rom_address(speech_rom_address),.rom_data(speech_rom_data),.rom_loaded(speech_loaded),.load_error(speech_error), + .data_request(speech_ready),.standby(speech_standby),.sample(speech_sample),.sample_valid(speech_valid), + .busy(speech_busy),.overrun(speech_overrun),.fault(speech_fault),.debug_pc(speech_pc),.frame_count(speech_frames)); +ssc_audio audio(clk,reset,audio_ce,ay_sum,speech_sample,audio_sample,audio_valid,sound_activity,audio_overrun,audio_busy); +endmodule diff --git a/rtl/ssc/ssc_glue.sv b/rtl/ssc/ssc_glue.sv new file mode 100644 index 0000000..ac743f3 --- /dev/null +++ b/rtl/ssc/ssc_glue.sv @@ -0,0 +1,135 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Coco 3 Plus: PIC7040 external ports and 2 KiB SRAM. +// Behavioral reference: VCCPlus a8a84f22 src/devices/ssc/ssc_core.cpp; +// MAME CoCo SSC wiring copyright Tim Lindner. Original notices: LICENSE. +// Chip execution/audio is external to this block. All signals use clk. +// Hold request/payload until io_ready, then withdraw request before another +// access. Chip strobes occur once even if a completed request remains asserted. +module ssc_glue ( + input wire clk, reset, + input wire io_request, io_write, + input wire [1:0] io_port, // A=0, B=1, C=2, D=3; GPIO values after PIC DDR + input wire [7:0] io_write_data, + output reg io_ready, + output reg [7:0] io_read_data, + output reg init_done, + input wire [7:0] command_data, + output reg command_read, + output wire pic_busy_line, + output reg ay_select, ay_write, + output reg [7:0] ay_bus_data, + input wire [7:0] ay_read_data, + output reg speech_ald, + output reg [5:0] speech_code +); +localparam [1:0] INITIALIZE=0, IDLE=1, EXECUTE=2, WAIT_RELEASE=3; +reg [1:0] state; +reg [10:0] clear_address; +reg access_write; +reg [1:0] access_port; +reg [7:0] access_data; +reg [7:0] port_b, port_c, port_d; +reg [7:0] ram [0:2047]; +reg [7:0] ram_read; +wire ram_clear = state == INITIALIZE; +wire ram_store = state == EXECUTE && access_write && access_port == 2 && + !access_data[4] && !access_data[3]; +wire [10:0] ram_write_address = ram_clear ? clear_address : {access_data[2:0],port_b}; +wire [7:0] ram_write_data = ram_clear ? 8'h00 : port_d; +wire ram_selected = !port_c[4] && port_c[3]; +wire ay_selected_read = !port_c[6] && !port_c[3] && port_c[0]; +// AY read overrides SRAM if both devices are selected, matching the reference. +wire [7:0] read_d = ay_selected_read ? ay_read_data : ram_selected ? ram_read : port_d; +assign pic_busy_line = port_c[7]; + +// Synchronous read/write inference, with a hardware scrub instead of resetting +// every memory element. Keep the future PIC in reset until init_done. +always @(posedge clk) begin + ram_read <= ram[{port_c[2:0],port_b}]; + if (!reset && (ram_clear || ram_store)) + ram[ram_write_address] <= ram_write_data; +end + +always @(posedge clk) begin + if (reset) begin + state <= INITIALIZE; + clear_address <= 0; + init_done <= 0; + io_ready <= 0; + io_read_data <= 0; + command_read <= 0; + ay_select <= 0; + ay_write <= 0; + ay_bus_data <= 0; + speech_ald <= 0; + speech_code <= 0; + access_write <= 0; + access_port <= 0; + access_data <= 0; + // Observable state after SscCore::Reset and the PIC's reset callbacks. + port_b <= 8'hFF; + port_c <= 8'h00; + port_d <= 8'h00; + end else begin + command_read <= 0; + ay_select <= 0; + ay_write <= 0; + speech_ald <= 0; + case (state) + INITIALIZE: begin + if (clear_address == 11'd2047) begin + init_done <= 1; + state <= IDLE; + end else clear_address <= clear_address + 1'b1; + end + IDLE: if (io_request) begin + access_write <= io_write; + access_port <= io_port; + access_data <= io_write_data; + state <= EXECUTE; + end + EXECUTE: begin + if (access_write) begin + case (access_port) + 1: port_b <= access_data; + 2: begin + port_c <= access_data; + if (!access_data[6] && access_data[3]) begin + ay_bus_data <= port_d; + ay_select <= access_data[0]; + ay_write <= !access_data[0]; + end + if (port_c[5] && !access_data[5] && port_d < 8'd64) begin + speech_ald <= 1; + speech_code <= port_d[5:0]; + end + end + 3: port_d <= access_data; + endcase + end else begin + case (access_port) + 0: begin + io_read_data <= command_data; + command_read <= 1; + end + 1: io_read_data <= port_b; + 2: io_read_data <= port_c; + 3: begin + io_read_data <= read_d; + port_d <= read_d; + end + endcase + end + io_ready <= 1; + state <= WAIT_RELEASE; + end + WAIT_RELEASE: if (!io_request) begin + io_ready <= 0; + state <= IDLE; + end + endcase + end +end +endmodule diff --git a/rtl/ssc/ssc_host.sv b/rtl/ssc/ssc_host.sv new file mode 100644 index 0000000..0a14519 --- /dev/null +++ b/rtl/ssc/ssc_host.sv @@ -0,0 +1,84 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Coco 3 Plus: Sound/Speech host interface. +// Behavioral reference: VCCPlus a8a84f22 src/devices/ssc/ssc_core.cpp; +// CoCo SSC wiring derives from MAME, copyright Tim Lindner. See LICENSE. +// This block does not implement the PIC, PSG, speech engine or audio circuit. +// All inputs must be synchronous to clk. host_write/pic_command_read are +// single-cycle transaction strobes, not unqualified CPU bus levels. +module ssc_host ( + input wire clk, + input wire reset, + input wire enable, + input wire host_read, + input wire host_write, + input wire [15:0] host_address, + input wire [7:0] host_data, + output wire host_read_valid, + output wire [7:0] host_read_data, + // Future controller's port A input and INT3 command request. + input wire pic_command_read, + input wire pic_busy_line, + output reg [7:0] command_data, + output reg command_irq, + output reg command_busy, + // Future engines supply these levels; this block does not synthesize them. + input wire speech_standby, + input wire sound_active, + // Reset requests last one clk tick (held asserted during global reset). + output reg controller_reset, + output reg speech_reset +); +localparam [15:0] CONTROL_ADDRESS = 16'hFF7D; +localparam [15:0] COMMAND_ADDRESS = 16'hFF7E; +reg reset_bit; +reg previous_busy_line; +wire control_write = enable && host_write && host_address == CONTROL_ADDRESS; +wire command_write = enable && host_write && host_address == COMMAND_ADDRESS; + +assign host_read_valid = enable && host_read && + (host_address == CONTROL_ADDRESS || host_address == COMMAND_ADDRESS); +// An unselected device contributes nothing to the shared read mux. +assign host_read_data = !host_read_valid ? 8'h00 : + host_address == CONTROL_ADDRESS ? 8'hFF : + { !command_busy, speech_standby, !sound_active, 5'b11111 }; + +always @(posedge clk) begin + if (reset) begin + reset_bit <= 1'b1; + previous_busy_line <= 1'b0; // controller reset drives port C to zero + command_data <= 8'h00; + command_irq <= 1'b0; + command_busy <= 1'b0; + controller_reset <= 1'b1; + speech_reset <= 1'b1; + end else begin + controller_reset <= 1'b0; + speech_reset <= 1'b0; + previous_busy_line <= pic_busy_line; + if (!previous_busy_line && pic_busy_line) + command_busy <= 1'b0; + if (pic_command_read) + command_irq <= 1'b0; + if (control_write) begin + reset_bit <= host_data[0]; + if (host_data[0]) speech_reset <= 1'b1; + if (reset_bit && !host_data[0]) begin + controller_reset <= 1'b1; + command_busy <= 1'b0; + command_irq <= 1'b0; + previous_busy_line <= 1'b0; + end + end + // A fresh host command wins over simultaneous completion/read strobes. + // The controller consuming port A on this edge sees the OLD payload; + // the new payload remains latched with INT3 asserted for its next read. + if (command_write) begin + command_data <= host_data; + command_busy <= 1'b1; + command_irq <= 1'b1; + end + end +end +endmodule diff --git a/rtl/ssc/ssc_mister_bridge.sv b/rtl/ssc/ssc_mister_bridge.sv new file mode 100644 index 0000000..975d8b6 --- /dev/null +++ b/rtl/ssc/ssc_mister_bridge.sv @@ -0,0 +1,109 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// MiSTer HPS file/bus/audio integration. Same57MHz domain; CPU commits on the +// negative edge, cartridge logic on the positive edge. Both half paths are timed. +module ssc_mister_bridge(input wire clk,reset,cpu_reset,mode, + input wire cpu_commit,cpu_rnw,input wire [15:0] cpu_address,input wire [7:0] cpu_data, + input wire ioctl_download,ioctl_wr,input wire [7:0] ioctl_index, + input wire [24:0] ioctl_address,input wire [7:0] ioctl_data, + input wire cartridge_operational,cartridge_fault, + input wire [7:0] cartridge_read_data,input wire signed [15:0] cartridge_audio, + input wire sound_enable,input wire [1:0] sound_select, + input wire [7:0] orchestra_left,orchestra_right,input wire [15:0] legacy_left,legacy_right, + output wire cartridge_reset,host_read,host_write,output wire [15:0] host_address, + output wire [7:0] host_data,output wire read_valid,output wire [7:0] read_data, + output wire palette_owner,rom_files_valid,load_fault, + output wire pic_begin,pic_write,output wire [11:0] pic_address,output wire [7:0] pic_data, + output wire speech_begin,speech_write,output wire [10:0] speech_address,output wire [7:0] speech_data, + output wire [15:0] audio_left,audio_right); +reg download_d,mode_d; +reg [5:0] file_kind; +reg [12:0] count; +reg malformed,pic_valid,speech_valid,pic_bad,speech_bad; +reg pipe_write; +reg [5:0] pipe_kind; +reg [24:0] pipe_address; +reg [7:0] pipe_data; +wire selected=ioctl_index[5:0]==4||ioctl_index[5:0]==5; +wire start=ioctl_download&&!download_d&&selected; +wire finish=!ioctl_download&&download_d; +wire transferring=ioctl_download&&(selected||file_kind==4||file_kind==5); +wire valid_length=(file_kind==4&&count==4096)||(file_kind==5&&count==2048); +assign pic_begin=start&&ioctl_index[5:0]==4; +assign speech_begin=start&&ioctl_index[5:0]==5; +assign pic_write=pipe_write&&pipe_kind==4; +assign speech_write=pipe_write&&pipe_kind==5; +assign pic_address=pipe_address[11:0];assign speech_address=pipe_address[10:0]; +assign pic_data=pipe_data;assign speech_data=pipe_data; +assign rom_files_valid=pic_valid&&speech_valid&&!transferring; +assign load_fault=pic_bad||speech_bad||cartridge_fault; +assign palette_owner=!mode; +assign cartridge_reset=cpu_reset||transferring||(mode!=mode_d); +always @(posedge clk)begin + if(reset)begin + download_d<=0;mode_d<=0;file_kind<=0;count<=0;malformed<=0; + pic_valid<=0;speech_valid<=0;pic_bad<=0;speech_bad<=0; + pipe_write<=0;pipe_kind<=0;pipe_address<=0;pipe_data<=0; + end else begin + download_d<=ioctl_download;mode_d<=mode; + pipe_write<=ioctl_download&&ioctl_wr&&selected; + pipe_kind<=ioctl_index[5:0];pipe_address<=ioctl_address;pipe_data<=ioctl_data; + if(start)begin + file_kind<=ioctl_index[5:0];count<=ioctl_wr?13'd1:13'd0; + malformed<=ioctl_wr&&ioctl_address!=0; + if(ioctl_index[5:0]==4)begin pic_valid<=0;pic_bad<=0;end + else begin speech_valid<=0;speech_bad<=0;end + end else if(ioctl_download&&ioctl_wr&&(file_kind==4||file_kind==5))begin + if(ioctl_index[5:0]!=file_kind||ioctl_address!={12'd0,count})malformed<=1; + if(count<4097)count<=count+13'd1;else malformed<=1; + end + if(finish)begin + if(file_kind==4)begin pic_valid<=!malformed&&valid_length;pic_bad<=malformed||!valid_length;end + else if(file_kind==5)begin speech_valid<=!malformed&&valid_length;speech_bad<=malformed||!valid_length;end + file_kind<=0; + end + end +end +// Toggle handshake captures an old CPU bus at its real negative-edge commit. +// It clears after the following positive-edge consume, leaving read data stable +// before a possible back-to-back CPU read on the next negative edge. +reg write_toggle=0,consumed_toggle=0; +reg [15:0] write_address; +reg [7:0] write_data; +reg cpu_mode=0; +reg [7:0] status_sample=8'h7f; +wire write_pending=write_toggle!=consumed_toggle; +always @(negedge clk)begin + // CPU and this snapshot consume OLD values on the same negative edge. + // The CPU therefore sees a full-cycle-stable status through its read mux; + // this adds at most one57MHz tick of status visibility, no CPU wait state. + cpu_mode<=mode; + if(reset||cpu_reset||!rom_files_valid)status_sample<=8'h7f; + else status_sample<=cartridge_read_data; + if(reset||cpu_reset)begin write_toggle<=0;write_address<=0;write_data<=0;end + else if(cpu_commit&&!cpu_rnw)begin + write_address<=cpu_address;write_data<=cpu_data;write_toggle<=!write_toggle; + end +end +always @(posedge clk)if(reset)consumed_toggle<=0;else consumed_toggle<=write_toggle; +assign host_address=write_address; +assign host_data=write_data; +assign host_write=write_pending&&!cpu_reset&&rom_files_valid&&mode; +assign host_read=1'b0; +assign read_valid=cpu_mode&&cpu_rnw&&(cpu_address==16'hff7d||cpu_address==16'hff7e); +assign read_data=!read_valid ? 8'd0 : cpu_address==16'hff7d ? 8'hff : + status_sample; +// In cartridge mux position replace the stale internal-DAC contribution. +// Orchestra remains independent stereo. Its reset midpoint is128/0x8080. +wire select_cartridge=mode&&sound_enable&&sound_select==2; +wire signed [17:0] contribution=rom_files_valid&&cartridge_operational ? + {{2{cartridge_audio[15]}},cartridge_audio} : 18'sd0; +wire signed [17:0] sum_left=$signed({2'd0,orchestra_left,orchestra_left})-18'sd128+contribution; +wire signed [17:0] sum_right=$signed({2'd0,orchestra_right,orchestra_right})-18'sd128+contribution; +function [15:0] saturate(input signed [17:0] value); + begin saturate=value<0 ? 16'd0 : value>18'sd65535 ? 16'hffff : value[15:0];end +endfunction +assign audio_left=select_cartridge?saturate(sum_left):legacy_left; +assign audio_right=select_cartridge?saturate(sum_right):legacy_right; +endmodule diff --git a/rtl/ssc/ssc_sp0256.sv b/rtl/ssc/ssc_sp0256.sv new file mode 100644 index 0000000..024c831 --- /dev/null +++ b/rtl/ssc/ssc_sp0256.sv @@ -0,0 +1,242 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// SP0256-AL2 cartridge engine. Public microsequencer/LPC algorithm derived from +// MAME Joseph Zbiciak, Tim Lindner, through pinned VCCPlus a8a84f22. See LICENSE. +// No mask ROM embedded. AL2's on-chip 2 KiB occupies byte addresses1000..17ff; +// unpopulated serial-ROM space reads zero. The cartridge has no host FIFO port. +// sample_ce is native speech clock/312; clk must allow completion before next CE. +module ssc_sp0256(input wire clk,reset,speech_reset,sample_ce, + input wire ald,input wire [5:0] allophone, + input wire rom_begin,rom_write,input wire [10:0] rom_address,input wire [7:0] rom_data, + output wire rom_loaded,load_error,output reg data_request,standby, + output reg signed [15:0] sample,output reg sample_valid,output wire busy, + output reg overrun,fault,output wire [18:0] debug_pc,output reg [31:0] frame_count); +`include "ssc_sp0256_tables.vh" +localparam [5:0] IDLE=0,MICRO=1,IMM=2,OPCODE=3,BRANCH=4, + CONTROL=5,FIELD_START=6,FIELD_APPLY=7,FIELD_NEXT=8,REGDEC=9, + COEF_B=10,COEF_F=11,EXCITE=12,FILTER_MULT=13,FILTER_SUM=14,LIMIT=15, + GET0=16,GET1=17,GET2=18,GET3=19,GET4=20,FILTER_PICK=21,COEF_DECODE=22,COEF_STORE=23; +reg [5:0] state,return_state; +reg [18:0] pc,stack,page; +assign debug_pc=pc; +assign busy=state!=IDLE; +reg halted,pending,fifo_selected,initialized; +reg [5:0] command,mode; +reg [3:0] immediate,opcode,bit_length; +reg [7:0] bit_value,control_index,control_last,byte0; +reg [15:0] control_word; +reg [15:0] next_byte; +reg first_valid,second_valid; +reg [10:0] read_address; +wire [7:0] read_data; +ssc_sp0256_memory memory(clk,reset,rom_begin,rom_write,rom_address,rom_data, + rom_loaded,load_error,read_address,read_data); +reg [7:0] r[0:15]; +reg signed [8:0] rpt; +reg signed [10:0] cnt; +reg [7:0] period; +reg [11:0] amplitude; +reg [14:0] rng; +reg interpolate; +reg signed [9:0] bcoef[0:5],fcoef[0:5]; +reg signed [15:0] z0[0:5],z1[0:5]; +reg signed [15:0] excitation; +reg signed [25:0] product_b,product_f; +reg signed [9:0] operand_b,operand_f,decoded_coefficient; +reg signed [15:0] operand_z0,operand_z1; +reg [7:0] coefficient_input; +reg coefficient_forward; +wire signed [31:0] filter_sum=$signed(excitation)+($signed(product_b)>>>9)+($signed(product_f)>>>8); +reg [2:0] section; +reg [12:0] micro_steps; +integer j; +wire pulse=period!=0 ? cnt<=0 : cnt<=1; +wire [7:0] next_amplitude=r[0]+r[14]; +wire [7:0] next_period=r[1]+r[15]; +wire [7:0] signed_field=control_word[12] && bit_value[control_word[3:0]-1] ? + (bit_value | (8'hff<>pc[2:0]) & ((16'h1<176 || control_last>176)begin fault<=1;sample<=0;sample_valid<=1;state<=IDLE;end + else begin control_word<=sp_control(control_index);state<=FIELD_START;end + end + FIELD_START:begin + if(control_word[15])for(j=0;j<16;j=j+1)r[j]<=0; + if(control_word[14])begin r[12]<=0;r[13]<=0;end + if(control_word[3:0]!=0)bits(control_word[3:0],FIELD_APPLY); + else state<=FIELD_NEXT; + end + FIELD_APPLY:begin + if(control_word[13])r[control_word[11:8]]<= + (r[control_word[11:8]] & ~(8'hff<>1)^(rng[0]?15'h4001:15'd0); + excitation<=rng[0]?$signed({4'd0,amplitude}):-$signed({4'd0,amplitude}); + end + if(pulse)begin + rpt<=rpt-9'sd1; + for(j=0;j<6;j=j+1)begin z0[j]<=0;z1[j]<=0;end + if(interpolate)begin + r[0]<=next_amplitude;r[1]<=next_period; + amplitude<=amp_decode(next_amplitude);period<=next_period; + end + end + section<=0;state<=(pulse && rpt<=1)?MICRO:FILTER_PICK; + end + FILTER_PICK:begin + operand_b<=bcoef[section];operand_f<=fcoef[section]; + operand_z0<=z0[section];operand_z1<=z1[section];state<=FILTER_MULT; + end + FILTER_MULT:begin + product_b<=$signed(operand_b)*$signed(operand_z1); + product_f<=$signed(operand_f)*$signed(operand_z0);state<=FILTER_SUM; + end + FILTER_SUM:begin + excitation<=filter_sum[15:0];z1[section]<=z0[section];z0[section]<=filter_sum[15:0]; + if(section==5)state<=LIMIT;else begin section<=section+3'd1;state<=FILTER_PICK;end + end + LIMIT:begin + sample<=excitation > 16'sd8191 ? 16'sd32764 : + excitation < -16'sd8192 ? 16'sh8000 : excitation<<<2; + sample_valid<=1;state<=IDLE; + end + GET0:begin + if(fifo_selected)begin bit_value<=0;state<=return_state;end + else begin + read_address<=pc[13:3];first_valid<=pc[18:14]==2; + next_byte<=pc[18:3]+16'd1;state<=GET1; + end + end + GET1:state<=GET2; + GET2:begin + byte0<=first_valid?read_data:8'd0;read_address<=next_byte[10:0]; + second_valid<=next_byte[15:11]==2;state<=GET3; + end + GET3:state<=GET4; + GET4:begin + bit_value<=rom_bit_window[7:0]; + pc<=pc+{15'd0,bit_length};state<=return_state; + end + default:begin fault<=1;state<=IDLE;end + endcase + // A newly accepted ALD wins over a simultaneous idle/microsequencer update. + if(ald && data_request && initialized)begin + command<=allophone;pending<=1;data_request<=0;standby<=0; + end + end +end +endmodule diff --git a/rtl/ssc/ssc_sp0256_memory.sv b/rtl/ssc/ssc_sp0256_memory.sv new file mode 100644 index 0000000..91c97ac --- /dev/null +++ b/rtl/ssc/ssc_sp0256_memory.sv @@ -0,0 +1,26 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Volatile, synchronous AL2 ROM. Original bytes arrive through a strict loader. +module ssc_sp0256_memory(input wire clk,reset,rom_begin,rom_write, + input wire [10:0] rom_address,input wire [7:0] rom_data, + output reg rom_loaded,load_error,input wire [10:0] read_address, + output reg [7:0] read_data); +reg [7:0] rom[0:2047]; +reg loading; +reg [11:0] expected; +always @(posedge clk)begin + read_data<=rom[read_address]; + if(reset)begin rom_loaded<=0;load_error<=0;loading<=0;expected<=0;end + else if(rom_begin)begin + rom_loaded<=0;load_error<=rom_write;loading<=!rom_write;expected<=0; + end else if(rom_write)begin + if(!loading || expected!= {1'b0,rom_address})begin + load_error<=1;rom_loaded<=0;loading<=0; + end else begin + rom[rom_address]<=rom_data;expected<=expected+12'd1; + if(expected==2047)begin rom_loaded<=1;loading<=0;end + end + end +end +endmodule diff --git a/rtl/ssc/ssc_sp0256_tables.vh b/rtl/ssc/ssc_sp0256_tables.vh new file mode 100644 index 0000000..94ac30b --- /dev/null +++ b/rtl/ssc/ssc_sp0256_tables.vh @@ -0,0 +1,455 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// GI SP0256 public algorithm tables, MAME Joseph Zbiciak/Tim Lindner. +// Derived from pinned VCCPlus sp0256.cpp; see LICENSE. No mask ROM. +// Generated by scripts/generate_ssc_sp0256_tables.py. +// Source SHA256: 970ee4a027f637de820a10f66b119e95aeb366c4242df23de949ce1dccd030a3 +function [15:0] sp_control(input [7:0] address); +begin case(address) + 8'd0: sp_control=16'h8000; + 8'd1: sp_control=16'h8008; + 8'd2: sp_control=16'h0108; + 8'd3: sp_control=16'h0208; + 8'd4: sp_control=16'h0308; + 8'd5: sp_control=16'h0408; + 8'd6: sp_control=16'h0508; + 8'd7: sp_control=16'h0608; + 8'd8: sp_control=16'h0708; + 8'd9: sp_control=16'h0808; + 8'd10: sp_control=16'h0908; + 8'd11: sp_control=16'h0a08; + 8'd12: sp_control=16'h0b08; + 8'd13: sp_control=16'h0c08; + 8'd14: sp_control=16'h0d08; + 8'd15: sp_control=16'h0e08; + 8'd16: sp_control=16'h0f08; + 8'd17: sp_control=16'h8026; + 8'd18: sp_control=16'h0108; + 8'd19: sp_control=16'h0834; + 8'd20: sp_control=16'h0926; + 8'd21: sp_control=16'h0a17; + 8'd22: sp_control=16'h0b26; + 8'd23: sp_control=16'h0c08; + 8'd24: sp_control=16'h0d08; + 8'd25: sp_control=16'h8026; + 8'd26: sp_control=16'h0108; + 8'd27: sp_control=16'h0816; + 8'd28: sp_control=16'h0917; + 8'd29: sp_control=16'h0a08; + 8'd30: sp_control=16'h0b08; + 8'd31: sp_control=16'h0c08; + 8'd32: sp_control=16'h0d08; + 8'd33: sp_control=16'h4000; + 8'd34: sp_control=16'h0026; + 8'd35: sp_control=16'h2926; + 8'd36: sp_control=16'h2b26; + 8'd37: sp_control=16'h2d08; + 8'd38: sp_control=16'h4000; + 8'd39: sp_control=16'h0026; + 8'd40: sp_control=16'h2917; + 8'd41: sp_control=16'h2b08; + 8'd42: sp_control=16'h2d08; + 8'd43: sp_control=16'h0000; + 8'd44: sp_control=16'h0000; + 8'd45: sp_control=16'h1024; + 8'd46: sp_control=16'h1105; + 8'd47: sp_control=16'h1243; + 8'd48: sp_control=16'h1333; + 8'd49: sp_control=16'h1443; + 8'd50: sp_control=16'h1533; + 8'd51: sp_control=16'h1643; + 8'd52: sp_control=16'h1733; + 8'd53: sp_control=16'h1833; + 8'd54: sp_control=16'h1924; + 8'd55: sp_control=16'h1a14; + 8'd56: sp_control=16'h1b24; + 8'd57: sp_control=16'h1c05; + 8'd58: sp_control=16'h1d05; + 8'd59: sp_control=16'h1024; + 8'd60: sp_control=16'h1105; + 8'd61: sp_control=16'h1214; + 8'd62: sp_control=16'h1324; + 8'd63: sp_control=16'h1414; + 8'd64: sp_control=16'h1524; + 8'd65: sp_control=16'h1614; + 8'd66: sp_control=16'h1724; + 8'd67: sp_control=16'h1814; + 8'd68: sp_control=16'h1915; + 8'd69: sp_control=16'h1a05; + 8'd70: sp_control=16'h1b05; + 8'd71: sp_control=16'h1c05; + 8'd72: sp_control=16'h1d05; + 8'd73: sp_control=16'h4000; + 8'd74: sp_control=16'h0026; + 8'd75: sp_control=16'h2335; + 8'd76: sp_control=16'h2535; + 8'd77: sp_control=16'h2735; + 8'd78: sp_control=16'h4000; + 8'd79: sp_control=16'h0026; + 8'd80: sp_control=16'h2326; + 8'd81: sp_control=16'h2526; + 8'd82: sp_control=16'h2726; + 8'd83: sp_control=16'h8026; + 8'd84: sp_control=16'h0108; + 8'd85: sp_control=16'h0243; + 8'd86: sp_control=16'h0335; + 8'd87: sp_control=16'h0443; + 8'd88: sp_control=16'h0535; + 8'd89: sp_control=16'h0643; + 8'd90: sp_control=16'h0735; + 8'd91: sp_control=16'h0834; + 8'd92: sp_control=16'h0926; + 8'd93: sp_control=16'h0a17; + 8'd94: sp_control=16'h0b26; + 8'd95: sp_control=16'h0e05; + 8'd96: sp_control=16'h0f05; + 8'd97: sp_control=16'h8026; + 8'd98: sp_control=16'h0108; + 8'd99: sp_control=16'h0216; + 8'd100: sp_control=16'h0326; + 8'd101: sp_control=16'h0416; + 8'd102: sp_control=16'h0526; + 8'd103: sp_control=16'h0616; + 8'd104: sp_control=16'h0726; + 8'd105: sp_control=16'h0816; + 8'd106: sp_control=16'h0917; + 8'd107: sp_control=16'h0a08; + 8'd108: sp_control=16'h0b08; + 8'd109: sp_control=16'h0e05; + 8'd110: sp_control=16'h0f05; + 8'd111: sp_control=16'h1024; + 8'd112: sp_control=16'h1105; + 8'd113: sp_control=16'h1833; + 8'd114: sp_control=16'h1924; + 8'd115: sp_control=16'h1a14; + 8'd116: sp_control=16'h1b24; + 8'd117: sp_control=16'h1c05; + 8'd118: sp_control=16'h1d05; + 8'd119: sp_control=16'h1024; + 8'd120: sp_control=16'h1105; + 8'd121: sp_control=16'h1814; + 8'd122: sp_control=16'h1915; + 8'd123: sp_control=16'h1a05; + 8'd124: sp_control=16'h1b05; + 8'd125: sp_control=16'h1c05; + 8'd126: sp_control=16'h1d05; + 8'd127: sp_control=16'h0026; + 8'd128: sp_control=16'h0108; + 8'd129: sp_control=16'h8026; + 8'd130: sp_control=16'h0108; + 8'd131: sp_control=16'h0243; + 8'd132: sp_control=16'h0335; + 8'd133: sp_control=16'h0443; + 8'd134: sp_control=16'h0535; + 8'd135: sp_control=16'h0643; + 8'd136: sp_control=16'h0735; + 8'd137: sp_control=16'h0834; + 8'd138: sp_control=16'h0926; + 8'd139: sp_control=16'h0a17; + 8'd140: sp_control=16'h0b26; + 8'd141: sp_control=16'h0c08; + 8'd142: sp_control=16'h0d08; + 8'd143: sp_control=16'h0e05; + 8'd144: sp_control=16'h0f05; + 8'd145: sp_control=16'h8026; + 8'd146: sp_control=16'h0108; + 8'd147: sp_control=16'h0216; + 8'd148: sp_control=16'h0326; + 8'd149: sp_control=16'h0416; + 8'd150: sp_control=16'h0526; + 8'd151: sp_control=16'h0616; + 8'd152: sp_control=16'h0726; + 8'd153: sp_control=16'h0816; + 8'd154: sp_control=16'h0917; + 8'd155: sp_control=16'h0a08; + 8'd156: sp_control=16'h0b08; + 8'd157: sp_control=16'h0c08; + 8'd158: sp_control=16'h0d08; + 8'd159: sp_control=16'h0e05; + 8'd160: sp_control=16'h0f05; + 8'd161: sp_control=16'h4000; + 8'd162: sp_control=16'h0026; + 8'd163: sp_control=16'h0108; + 8'd164: sp_control=16'h2335; + 8'd165: sp_control=16'h2535; + 8'd166: sp_control=16'h2735; + 8'd167: sp_control=16'h0e05; + 8'd168: sp_control=16'h0f05; + 8'd169: sp_control=16'h4000; + 8'd170: sp_control=16'h0026; + 8'd171: sp_control=16'h0108; + 8'd172: sp_control=16'h2326; + 8'd173: sp_control=16'h2526; + 8'd174: sp_control=16'h2726; + 8'd175: sp_control=16'h0e05; + 8'd176: sp_control=16'h0f05; + default: sp_control=16'h0; +endcase end +endfunction +function [7:0] sp_index(input [6:0] address); +begin case(address) + 7'd0: sp_index=8'hff; + 7'd1: sp_index=8'hff; + 7'd2: sp_index=8'hff; + 7'd3: sp_index=8'hff; + 7'd4: sp_index=8'hff; + 7'd5: sp_index=8'hff; + 7'd6: sp_index=8'hff; + 7'd7: sp_index=8'hff; + 7'd8: sp_index=8'hff; + 7'd9: sp_index=8'hff; + 7'd10: sp_index=8'hff; + 7'd11: sp_index=8'hff; + 7'd12: sp_index=8'hff; + 7'd13: sp_index=8'hff; + 7'd14: sp_index=8'hff; + 7'd15: sp_index=8'hff; + 7'd16: sp_index=8'h11; + 7'd17: sp_index=8'h16; + 7'd18: sp_index=8'h11; + 7'd19: sp_index=8'h18; + 7'd20: sp_index=8'h19; + 7'd21: sp_index=8'h1e; + 7'd22: sp_index=8'h19; + 7'd23: sp_index=8'h20; + 7'd24: sp_index=8'h53; + 7'd25: sp_index=8'h5e; + 7'd26: sp_index=8'h81; + 7'd27: sp_index=8'h8e; + 7'd28: sp_index=8'h61; + 7'd29: sp_index=8'h6c; + 7'd30: sp_index=8'h91; + 7'd31: sp_index=8'h9e; + 7'd32: sp_index=8'h53; + 7'd33: sp_index=8'h60; + 7'd34: sp_index=8'h81; + 7'd35: sp_index=8'h90; + 7'd36: sp_index=8'h61; + 7'd37: sp_index=8'h6e; + 7'd38: sp_index=8'h91; + 7'd39: sp_index=8'ha0; + 7'd40: sp_index=8'h49; + 7'd41: sp_index=8'h4d; + 7'd42: sp_index=8'h4a; + 7'd43: sp_index=8'h4d; + 7'd44: sp_index=8'h4e; + 7'd45: sp_index=8'h52; + 7'd46: sp_index=8'h4f; + 7'd47: sp_index=8'h52; + 7'd48: sp_index=8'h21; + 7'd49: sp_index=8'h24; + 7'd50: sp_index=8'h22; + 7'd51: sp_index=8'h25; + 7'd52: sp_index=8'h26; + 7'd53: sp_index=8'h29; + 7'd54: sp_index=8'h27; + 7'd55: sp_index=8'h2a; + 7'd56: sp_index=8'h7f; + 7'd57: sp_index=8'h80; + 7'd58: sp_index=8'h7f; + 7'd59: sp_index=8'h80; + 7'd60: sp_index=8'h7f; + 7'd61: sp_index=8'h80; + 7'd62: sp_index=8'h7f; + 7'd63: sp_index=8'h80; + 7'd64: sp_index=8'h01; + 7'd65: sp_index=8'h0e; + 7'd66: sp_index=8'h01; + 7'd67: sp_index=8'h10; + 7'd68: sp_index=8'h01; + 7'd69: sp_index=8'h0e; + 7'd70: sp_index=8'h01; + 7'd71: sp_index=8'h10; + 7'd72: sp_index=8'h2d; + 7'd73: sp_index=8'h38; + 7'd74: sp_index=8'h2d; + 7'd75: sp_index=8'h3a; + 7'd76: sp_index=8'h3b; + 7'd77: sp_index=8'h46; + 7'd78: sp_index=8'h3b; + 7'd79: sp_index=8'h48; + 7'd80: sp_index=8'ha1; + 7'd81: sp_index=8'ha6; + 7'd82: sp_index=8'ha2; + 7'd83: sp_index=8'ha6; + 7'd84: sp_index=8'ha9; + 7'd85: sp_index=8'hae; + 7'd86: sp_index=8'haa; + 7'd87: sp_index=8'hae; + 7'd88: sp_index=8'h6f; + 7'd89: sp_index=8'h74; + 7'd90: sp_index=8'h6f; + 7'd91: sp_index=8'h76; + 7'd92: sp_index=8'h77; + 7'd93: sp_index=8'h7c; + 7'd94: sp_index=8'h77; + 7'd95: sp_index=8'h7e; + 7'd96: sp_index=8'ha1; + 7'd97: sp_index=8'ha8; + 7'd98: sp_index=8'ha2; + 7'd99: sp_index=8'ha8; + 7'd100: sp_index=8'ha9; + 7'd101: sp_index=8'hb0; + 7'd102: sp_index=8'haa; + 7'd103: sp_index=8'hb0; + 7'd104: sp_index=8'hff; + 7'd105: sp_index=8'hff; + 7'd106: sp_index=8'hff; + 7'd107: sp_index=8'hff; + 7'd108: sp_index=8'hff; + 7'd109: sp_index=8'hff; + 7'd110: sp_index=8'hff; + 7'd111: sp_index=8'hff; + 7'd112: sp_index=8'hff; + 7'd113: sp_index=8'hff; + 7'd114: sp_index=8'hff; + 7'd115: sp_index=8'hff; + 7'd116: sp_index=8'hff; + 7'd117: sp_index=8'hff; + 7'd118: sp_index=8'hff; + 7'd119: sp_index=8'hff; + 7'd120: sp_index=8'h00; + 7'd121: sp_index=8'h00; + 7'd122: sp_index=8'h00; + 7'd123: sp_index=8'h00; + 7'd124: sp_index=8'h00; + 7'd125: sp_index=8'h00; + 7'd126: sp_index=8'h00; + 7'd127: sp_index=8'h00; + default: sp_index=8'hff; +endcase end +endfunction +function [8:0] sp_quant(input [6:0] address); +begin case(address) + 7'd0: sp_quant=9'h000; + 7'd1: sp_quant=9'h009; + 7'd2: sp_quant=9'h011; + 7'd3: sp_quant=9'h019; + 7'd4: sp_quant=9'h021; + 7'd5: sp_quant=9'h029; + 7'd6: sp_quant=9'h031; + 7'd7: sp_quant=9'h039; + 7'd8: sp_quant=9'h041; + 7'd9: sp_quant=9'h049; + 7'd10: sp_quant=9'h051; + 7'd11: sp_quant=9'h059; + 7'd12: sp_quant=9'h061; + 7'd13: sp_quant=9'h069; + 7'd14: sp_quant=9'h071; + 7'd15: sp_quant=9'h079; + 7'd16: sp_quant=9'h081; + 7'd17: sp_quant=9'h089; + 7'd18: sp_quant=9'h091; + 7'd19: sp_quant=9'h099; + 7'd20: sp_quant=9'h0a1; + 7'd21: sp_quant=9'h0a9; + 7'd22: sp_quant=9'h0b1; + 7'd23: sp_quant=9'h0b9; + 7'd24: sp_quant=9'h0c1; + 7'd25: sp_quant=9'h0c9; + 7'd26: sp_quant=9'h0d1; + 7'd27: sp_quant=9'h0d9; + 7'd28: sp_quant=9'h0e1; + 7'd29: sp_quant=9'h0e9; + 7'd30: sp_quant=9'h0f1; + 7'd31: sp_quant=9'h0f9; + 7'd32: sp_quant=9'h101; + 7'd33: sp_quant=9'h109; + 7'd34: sp_quant=9'h111; + 7'd35: sp_quant=9'h119; + 7'd36: sp_quant=9'h121; + 7'd37: sp_quant=9'h129; + 7'd38: sp_quant=9'h12d; + 7'd39: sp_quant=9'h131; + 7'd40: sp_quant=9'h135; + 7'd41: sp_quant=9'h139; + 7'd42: sp_quant=9'h13d; + 7'd43: sp_quant=9'h141; + 7'd44: sp_quant=9'h145; + 7'd45: sp_quant=9'h149; + 7'd46: sp_quant=9'h14d; + 7'd47: sp_quant=9'h151; + 7'd48: sp_quant=9'h155; + 7'd49: sp_quant=9'h159; + 7'd50: sp_quant=9'h15d; + 7'd51: sp_quant=9'h161; + 7'd52: sp_quant=9'h165; + 7'd53: sp_quant=9'h169; + 7'd54: sp_quant=9'h16d; + 7'd55: sp_quant=9'h171; + 7'd56: sp_quant=9'h175; + 7'd57: sp_quant=9'h179; + 7'd58: sp_quant=9'h17d; + 7'd59: sp_quant=9'h181; + 7'd60: sp_quant=9'h185; + 7'd61: sp_quant=9'h189; + 7'd62: sp_quant=9'h18d; + 7'd63: sp_quant=9'h191; + 7'd64: sp_quant=9'h195; + 7'd65: sp_quant=9'h199; + 7'd66: sp_quant=9'h19d; + 7'd67: sp_quant=9'h1a1; + 7'd68: sp_quant=9'h1a5; + 7'd69: sp_quant=9'h1a9; + 7'd70: sp_quant=9'h1ab; + 7'd71: sp_quant=9'h1ad; + 7'd72: sp_quant=9'h1af; + 7'd73: sp_quant=9'h1b1; + 7'd74: sp_quant=9'h1b3; + 7'd75: sp_quant=9'h1b5; + 7'd76: sp_quant=9'h1b7; + 7'd77: sp_quant=9'h1b9; + 7'd78: sp_quant=9'h1bb; + 7'd79: sp_quant=9'h1bd; + 7'd80: sp_quant=9'h1bf; + 7'd81: sp_quant=9'h1c1; + 7'd82: sp_quant=9'h1c3; + 7'd83: sp_quant=9'h1c5; + 7'd84: sp_quant=9'h1c7; + 7'd85: sp_quant=9'h1c9; + 7'd86: sp_quant=9'h1cb; + 7'd87: sp_quant=9'h1cd; + 7'd88: sp_quant=9'h1cf; + 7'd89: sp_quant=9'h1d1; + 7'd90: sp_quant=9'h1d3; + 7'd91: sp_quant=9'h1d5; + 7'd92: sp_quant=9'h1d7; + 7'd93: sp_quant=9'h1d9; + 7'd94: sp_quant=9'h1db; + 7'd95: sp_quant=9'h1dd; + 7'd96: sp_quant=9'h1df; + 7'd97: sp_quant=9'h1e1; + 7'd98: sp_quant=9'h1e2; + 7'd99: sp_quant=9'h1e3; + 7'd100: sp_quant=9'h1e4; + 7'd101: sp_quant=9'h1e5; + 7'd102: sp_quant=9'h1e6; + 7'd103: sp_quant=9'h1e7; + 7'd104: sp_quant=9'h1e8; + 7'd105: sp_quant=9'h1e9; + 7'd106: sp_quant=9'h1ea; + 7'd107: sp_quant=9'h1eb; + 7'd108: sp_quant=9'h1ec; + 7'd109: sp_quant=9'h1ed; + 7'd110: sp_quant=9'h1ee; + 7'd111: sp_quant=9'h1ef; + 7'd112: sp_quant=9'h1f0; + 7'd113: sp_quant=9'h1f1; + 7'd114: sp_quant=9'h1f2; + 7'd115: sp_quant=9'h1f3; + 7'd116: sp_quant=9'h1f4; + 7'd117: sp_quant=9'h1f5; + 7'd118: sp_quant=9'h1f6; + 7'd119: sp_quant=9'h1f7; + 7'd120: sp_quant=9'h1f8; + 7'd121: sp_quant=9'h1f9; + 7'd122: sp_quant=9'h1fa; + 7'd123: sp_quant=9'h1fb; + 7'd124: sp_quant=9'h1fc; + 7'd125: sp_quant=9'h1fd; + 7'd126: sp_quant=9'h1fe; + 7'd127: sp_quant=9'h1ff; + default: sp_quant=9'h0; +endcase end +endfunction diff --git a/rtl/ssc/ssc_tms7000.sv b/rtl/ssc/ssc_tms7000.sv new file mode 100644 index 0000000..f543929 --- /dev/null +++ b/rtl/ssc/ssc_tms7000.sv @@ -0,0 +1,60 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Volatile-ROM PIC7040 controller. VCCPlus/MAME/TI provenance: LICENSE/docs. +// No user firmware embedded. All external signals synchronous to clk. +// icount_tick must pulse once per phi (PIC input clock /2); no clock is gated. +module ssc_tms7000(input wire clk,reset,controller_reset,icount_tick, + input wire rom_begin,rom_write,input wire [11:0] rom_address,input wire [7:0] rom_data, + output wire rom_loaded,load_error,initialized,overrun, + output wire [15:0] debug_pc,output wire [31:0] illegal_count, + input wire irq1,irq3,timer_external, + output wire gpio_request,gpio_write,output wire [1:0] gpio_port, + output wire [7:0] gpio_write_data,input wire gpio_ready,input wire [7:0] gpio_read_data); +wire memory_initialized,io_initialized,engine_initialized,engine_done,irq_valid,irq_ack; +wire [1:0] irq_index; +wire [15:0] pc,mem_address; +wire [7:0] sp,status,mem_data,mem_read_data,pf_address,pf_data,pf_read_data; +wire [31:0] illegal; +wire [6:0] cycles; +wire idle,mem_request,mem_write,mem_peripheral,mem_ready,pf_request,pf_write,pf_ready; +wire step,quiet; +reg pending_reset; +reg [2:0] reset_state; +reg io_restart,engine_restart; +reg [1:0] acknowledged_irq; +localparam [2:0] NORMAL=0,IO_WAIT_LOW=1,IO_WAIT_HIGH=2,CPU_WAIT_LOW=3,CPU_WAIT_HIGH=4; +wire cold_reset=reset||rom_begin||!memory_initialized||!rom_loaded; +wire engine_reset=cold_reset||(!io_initialized && reset_state==NORMAL); +wire run=engine_initialized && io_initialized && !cold_reset && !pending_reset && reset_state==NORMAL; +assign initialized=run && !overrun; +assign debug_pc=pc;assign illegal_count=illegal; +ssc_tms7000_exec engine(clk,engine_reset,engine_restart,step,irq_valid,irq_index, + irq_ack,engine_initialized,engine_done,pc,sp,status,idle,illegal,cycles, + mem_request,mem_write,mem_peripheral,mem_address,mem_data,mem_ready,mem_read_data); +ssc_tms7000_memory memory(clk,reset,rom_begin,rom_write,rom_address,rom_data, + rom_loaded,load_error,memory_initialized,mem_request,mem_write,mem_peripheral, + mem_address,mem_data,mem_ready,mem_read_data,pf_request,pf_write,pf_address,pf_data,pf_ready,pf_read_data); +ssc_tms7000_io peripherals(clk,reset||rom_begin,io_restart,io_initialized, + pf_request,pf_write,pf_address,pf_data,pf_ready,pf_read_data, + icount_tick && !cold_reset && (run||!quiet),irq1,irq3,timer_external, + irq_ack,acknowledged_irq,irq_valid,irq_index,gpio_request,gpio_write,gpio_port,gpio_write_data,gpio_ready,gpio_read_data); +ssc_tms7000_pacer scheduler(clk,cold_reset||!engine_initialized,run,icount_tick, + engine_done,cycles,step,quiet,overrun); +always @(posedge clk)begin + if(reset)acknowledged_irq<=0;else acknowledged_irq<=irq_index; + if(cold_reset)begin pending_reset<=0;reset_state<=NORMAL;io_restart<=0;engine_restart<=0;end + else begin + io_restart<=0;engine_restart<=0; + if(controller_reset)pending_reset<=1; + case(reset_state) + NORMAL:if(pending_reset && quiet)begin pending_reset<=0;io_restart<=1;reset_state<=IO_WAIT_LOW;end + IO_WAIT_LOW:if(!io_initialized)reset_state<=IO_WAIT_HIGH; + IO_WAIT_HIGH:if(io_initialized)begin engine_restart<=1;reset_state<=CPU_WAIT_LOW;end + CPU_WAIT_LOW:if(!engine_initialized)reset_state<=CPU_WAIT_HIGH; + CPU_WAIT_HIGH:if(engine_initialized)reset_state<=NORMAL; + default:reset_state<=NORMAL; + endcase + end +end +endmodule diff --git a/rtl/ssc/ssc_tms7000_alu.sv b/rtl/ssc/ssc_tms7000_alu.sv new file mode 100644 index 0000000..735703f --- /dev/null +++ b/rtl/ssc/ssc_tms7000_alu.sv @@ -0,0 +1,52 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// TMS7000 arithmetic/flags, from VCCPlus a8a84f22/MAME hap, Tim Lindner. +// Decimal/multiply use separate registered datapaths. Carry conventions: LICENSE. +module ssc_tms7000_alu(input wire [5:0] operation, + input wire [15:0] destination, input wire [7:0] source,status, + output reg [15:0] result, output reg [7:0] next_status, + output reg writeback, output reg branch, output reg [5:0] extra_cycles); +`include "ssc_tms7000_defs.vh" +reg [16:0] temp; +reg [8:0] flags_value; +reg set_flags,subtract; +always @* begin + temp=0;flags_value=0;result=0;next_status=status;writeback=1;branch=0; + extra_cycles=0;set_flags=1;subtract=0; + case(operation) + OP_MOV:temp={9'd0,source}; + OP_AND:temp={9'd0,(destination[7:0]&source)}; + OP_OR:temp={9'd0,(destination[7:0]|source)}; + OP_XOR:temp={9'd0,(destination[7:0]^source)}; + OP_BTJO,OP_BTJZ:begin + temp={9'd0,((operation==OP_BTJO?destination[7:0]:~destination[7:0])&source)}; + writeback=0;branch=(temp!=0);extra_cycles=branch?6'd4:6'd2; + end + OP_ADD:temp={9'd0,destination[7:0]}+{9'd0,source}; + OP_ADC:temp={9'd0,destination[7:0]}+{9'd0,source}+{16'd0,status[7]}; + OP_SUB,OP_CMP:begin temp={9'd0,destination[7:0]}-{9'd0,source};subtract=1;writeback=(operation!=OP_CMP);end + OP_SBB:begin temp={9'd0,destination[7:0]}-{9'd0,source}-{16'd0,!status[7]};subtract=1;end + // MPY has its own registered datapath in the instruction engine. + OP_DEC:begin temp={9'd0,destination[7:0]}-17'd1;subtract=1;end + OP_INC:temp={9'd0,destination[7:0]}+17'd1; + OP_INV:temp={9'd0,~destination[7:0]}; + OP_CLR:temp=0; + OP_XCHB:begin temp={9'd0,source};extra_cycles=1;end + OP_SWAP:begin temp={5'd0,destination[7:0],4'd0}|{13'd0,destination[7:4]};extra_cycles=3;end + OP_RR:temp={1'd0,destination[7:0],destination[0],destination[7:1]}; + OP_RRC:temp={1'd0,destination[7:0],status[7],destination[7:1]}; + OP_RL:temp={8'd0,destination[7:0],destination[7]}; + OP_RLC:temp={8'd0,destination[7:0],status[7]}; + OP_DJNZ:begin temp={9'd0,destination[7:0]}-17'd1;branch=(temp[15:0]!=0);extra_cycles=branch?6'd4:6'd2;set_flags=0;end + OP_DECD:begin temp={1'b0,destination}-17'd1;subtract=1;end + default:begin writeback=0;set_flags=0;end + endcase + result=temp[15:0]; + flags_value=(operation==OP_MPY || operation==OP_DECD)?temp[16:8]:temp[8:0]; + if(set_flags) begin + next_status={flags_value[8],flags_value[7],(flags_value[7:0]==0),status[4:0]}; + if(subtract) next_status[7]=!flags_value[8]; + end +end +endmodule diff --git a/rtl/ssc/ssc_tms7000_bcd.sv b/rtl/ssc/ssc_tms7000_bcd.sv new file mode 100644 index 0000000..fc4eeb9 --- /dev/null +++ b/rtl/ssc/ssc_tms7000_bcd.sv @@ -0,0 +1,32 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Two-stage parallel decimal adjust, VCCPlus/MAME TMS7000; see LICENSE. +// No operation-select mux precedes the nibble arithmetic. Both results are +// available two rising edges after stable operands, including invalid BCD. +module ssc_tms7000_bcd(input wire clk,reset,input wire [7:0] destination,source, + input wire carry,output reg [7:0] add_result,sub_result, + output reg add_carry,sub_carry); +reg [7:0] add_base,sub_base; +reg [2:0] add_adjust,sub_adjust; +wire [5:0] high_sum={2'd0,destination[7:4]}+{2'd0,source[7:4]}; +wire [5:0] low_sum={2'd0,destination[3:0]}+{2'd0,source[3:0]}+{5'd0,carry}; +wire low_borrow={1'b0,destination[3:0]}<({1'b0,source[3:0]}+{4'd0,!carry}); +function [7:0] correction(input [2:0] index); + begin case(index) 1:correction=8'h06;3,5:correction=8'h66;4:correction=8'h60;default:correction=0;endcase end +endfunction +always @(posedge clk)begin + if(reset)begin + add_base<=0;sub_base<=0;add_adjust<=0;sub_adjust<=0; + add_result<=0;sub_result<=0;add_carry<=0;sub_carry<=0; + end else begin + add_base<=destination+source+{7'd0,carry}; + sub_base<=destination-source-{7'd0,!carry}; + add_adjust<={(high_sum>9),(high_sum==9),(low_sum>=10)}; + sub_adjust<={(destination[7:4]2);sub_carry<=(sub_adjust<=2); + end +end +endmodule diff --git a/rtl/ssc/ssc_tms7000_decode.sv b/rtl/ssc/ssc_tms7000_decode.sv new file mode 100644 index 0000000..cc889bc --- /dev/null +++ b/rtl/ssc/ssc_tms7000_decode.sv @@ -0,0 +1,89 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Full original TMS7000 opcode map. VCCPlus/MAME reference; see LICENSE. +module ssc_tms7000_decode(input wire [7:0] opcode, + output reg [5:0] operation,output reg [4:0] mode, + output reg [5:0] base_cycles); +`include "ssc_tms7000_defs.vh" +reg [5:0] binary_operation,unary_operation; +always @* begin + binary_operation=OP_BAD;unary_operation=OP_BAD; + case(opcode[3:0]) + 2:binary_operation=OP_MOV;3:binary_operation=OP_AND;4:binary_operation=OP_OR; + 5:binary_operation=OP_XOR;6:binary_operation=OP_BTJO;7:binary_operation=OP_BTJZ; + 8:binary_operation=OP_ADD;9:binary_operation=OP_ADC;10:binary_operation=OP_SUB; + 11:binary_operation=OP_SBB;12:binary_operation=OP_MPY;13:binary_operation=OP_CMP; + 14:binary_operation=OP_DAC;15:binary_operation=OP_DSB; + default:binary_operation=OP_BAD; + endcase + case(opcode[3:0]) + 2:unary_operation=OP_DEC;3:unary_operation=OP_INC;4:unary_operation=OP_INV; + 5:unary_operation=OP_CLR;6:unary_operation=OP_XCHB;7:unary_operation=OP_SWAP; + 8:unary_operation=OP_PUSH;9:unary_operation=OP_POP;10:unary_operation=OP_DJNZ; + 11:unary_operation=OP_DECD;12:unary_operation=OP_RR;13:unary_operation=OP_RRC; + 14:unary_operation=OP_RL;15:unary_operation=OP_RLC; + default:unary_operation=OP_BAD; + endcase + operation=OP_BAD;mode=AM_NONE;base_cycles=5; + if(opcode>=8'h12 && opcode<=8'h7f && opcode[3:0]>=2) begin + operation=binary_operation; + case(opcode[7:4]) + 1:begin mode=AM_R_A;base_cycles=8;end + 2:begin mode=AM_I_A;base_cycles=7;end + 3:begin mode=AM_R_B;base_cycles=8;end + 4:begin mode=AM_R_R;base_cycles=10;end + 5:begin mode=AM_I_B;base_cycles=7;end + 6:begin mode=AM_B_A;base_cycles=5;end + 7:begin mode=AM_I_R;base_cycles=9;end + default:begin mode=AM_NONE;operation=OP_BAD;end + endcase + end else if(opcode>=8'hb0 && opcode<=8'hdf) begin + operation=unary_operation; + mode=(opcode[7:4]==11)?AM_A:(opcode[7:4]==12)?AM_B:AM_R; + base_cycles=(mode==AM_R)?6'd7:6'd5; + case(opcode[3:0]) + 0:begin operation=OP_MOV;mode=(opcode[7:4]==11)?AM_A_A:(opcode[7:4]==12)?AM_A_B:AM_A_R;base_cycles=(mode==AM_A_R)?6'd8:6'd6;end + 1:begin operation=OP_MOV;mode=(opcode[7:4]==11)?AM_B_A:(opcode[7:4]==12)?AM_B_B:AM_B_R;base_cycles=(mode==AM_B_A)?6'd5:(mode==AM_B_R)?6'd7:6'd6;end + 8,9:base_cycles=(mode==AM_R)?6'd8:6'd6; + 11:base_cycles=(mode==AM_R)?6'd11:6'd9; + default:begin end + endcase + end else if(opcode>=8'he8) begin operation=OP_TRAP;base_cycles=14;end + else if(opcode>=8'he0) begin operation=OP_JUMP;base_cycles=3;end + else case(opcode) + 8'h00:operation=OP_NOP; + 8'h01:begin operation=OP_IDLE;base_cycles=6;end + 8'h05:operation=OP_EINT; + 8'h06:operation=OP_DINT; + 8'h07:operation=OP_SETC; + 8'h08:begin operation=OP_POPST;base_cycles=6;end + 8'h09:begin operation=OP_STSP;base_cycles=6;end + 8'h0a:begin operation=OP_RETS;base_cycles=7;end + 8'h0b:begin operation=OP_RETI;base_cycles=9;end + 8'h0d:operation=OP_LDSP; + 8'h0e:begin operation=OP_PUSHST;base_cycles=6;end + 8'h80:begin operation=OP_MOV;mode=AM_P_A;base_cycles=9;end + 8'h91:begin operation=OP_MOV;mode=AM_P_B;base_cycles=8;end + default:begin + if(opcode[7:4]>=8 && opcode[7:4]<=10) begin + if(opcode[3:0]>=2 && opcode[3:0]<=7) begin + operation=binary_operation;mode=(opcode[7:4]==8)?AM_A_P:(opcode[7:4]==9)?AM_B_P:AM_I_P; + base_cycles=(opcode[7:4]==8)?6'd10:(opcode[7:4]==9)?6'd9:6'd11; + end else begin + mode=(opcode[7:4]==8)?AM_DIR:(opcode[7:4]==9)?AM_IND:AM_INX; + case(opcode[3:0]) + 8:begin operation=OP_MOVD;base_cycles=(mode==AM_DIR)?6'd15:(mode==AM_IND)?6'd14:6'd17;end + 10:begin operation=OP_LDA;base_cycles=(mode==AM_DIR)?6'd11:(mode==AM_IND)?6'd10:6'd13;end + 11:begin operation=OP_STA;base_cycles=(mode==AM_DIR)?6'd11:(mode==AM_IND)?6'd10:6'd13;end + 12:begin operation=OP_BR;base_cycles=(mode==AM_DIR)?6'd10:(mode==AM_IND)?6'd9:6'd12;end + 13:begin operation=OP_CMPA;base_cycles=(mode==AM_DIR)?6'd12:(mode==AM_IND)?6'd11:6'd14;end + 14:begin operation=OP_CALL;base_cycles=(mode==AM_DIR)?6'd14:(mode==AM_IND)?6'd13:6'd16;end + default:mode=AM_NONE; + endcase + end + end + end + endcase +end +endmodule diff --git a/rtl/ssc/ssc_tms7000_defs.vh b/rtl/ssc/ssc_tms7000_defs.vh new file mode 100644 index 0000000..2faf0ed --- /dev/null +++ b/rtl/ssc/ssc_tms7000_defs.vh @@ -0,0 +1,19 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Local instruction/micro-operation identifiers, not chip opcode encodings. +// Behavioral port of VCCPlus/MAME TMS7000; notices in LICENSE. +localparam [5:0] OP_BAD=0, OP_MOV=1, OP_AND=2, OP_OR=3, OP_XOR=4, + OP_BTJO=5, OP_BTJZ=6, OP_ADD=7, OP_ADC=8, OP_SUB=9, OP_SBB=10, + OP_MPY=11, OP_CMP=12, OP_DAC=13, OP_DSB=14, OP_DEC=15, OP_INC=16, + OP_INV=17, OP_CLR=18, OP_XCHB=19, OP_SWAP=20, OP_RR=21, OP_RRC=22, + OP_RL=23, OP_RLC=24, OP_DJNZ=25, OP_DECD=26, OP_PUSH=27, OP_POP=28, + OP_NOP=29, OP_IDLE=30, OP_EINT=31, OP_DINT=32, OP_SETC=33, + OP_POPST=34, OP_STSP=35, OP_RETS=36, OP_RETI=37, OP_LDSP=38, + OP_PUSHST=39, OP_JUMP=40, OP_TRAP=41, OP_LDA=42, OP_STA=43, + OP_BR=44, OP_CALL=45, OP_MOVD=46, OP_CMPA=47; +localparam [4:0] AM_NONE=0, AM_R_A=1, AM_I_A=2, AM_R_B=3, AM_R_R=4, + AM_I_B=5, AM_B_A=6, AM_I_R=7, AM_P_A=8, AM_A_P=9, AM_P_B=10, + AM_B_P=11, AM_I_P=12, AM_A=13, AM_B=14, AM_R=15, + AM_A_A=16, AM_A_B=17, AM_B_B=18, AM_A_R=19, AM_B_R=20, + AM_DIR=21, AM_IND=22, AM_INX=23; diff --git a/rtl/ssc/ssc_tms7000_exec.sv b/rtl/ssc/ssc_tms7000_exec.sv new file mode 100644 index 0000000..321f91d --- /dev/null +++ b/rtl/ssc/ssc_tms7000_exec.sv @@ -0,0 +1,285 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// TMS7000 instruction engine, behavioral port of VCCPlus a8a84f22 / MAME. +// Copyright/provenance: hap, Tim Lindner; original notices in LICENSE. +// All state uses clk. One step executes one instruction OR interrupt entry. +// cycles reports architectural icount (/2 input clock), NOT fabric clocks. +// The future scheduler must pace steps/timer ticks; no chip clock is generated. +// External memory supplies RF, peripheral file and ROM with a held-request bus. +// Reset does the CPU reset TRAP; GPIO reset callbacks belong to the wrapper. +module ssc_tms7000_exec(input wire clk,reset,restart,step, + input wire irq_valid,input wire [1:0] irq_index, + output reg irq_ack,output reg initialized,done, + output reg [15:0] pc,output reg [7:0] sp,status, + output reg idle,output reg [31:0] illegal_count,output reg [6:0] cycles, + output reg mem_request,mem_write,mem_peripheral,output reg [15:0] mem_address, + output reg [7:0] mem_write_data,input wire mem_ready,input wire [7:0] mem_read_data); +`include "ssc_tms7000_defs.vh" +localparam [6:0] RESET_START=0,WAIT_STEP=1,FETCHED=2,DECODE=3, + SRC_INDEX=4,SRC_VALUE=5,DEST_START=6,DEST_INDEX=7,DEST_VALUE=8,ALU=9, + UNARY_START=10,UNARY_INDEX=11,PAIR_HIGH=12,PAIR_LOW=13,XCH_VALUE=14, + WRITE_RESULT=15,WRITE_PAIR_LOW=16,BRANCH_START=17,BRANCH_VALUE=18, + ADDRESS_START=19,ADDRESS_HIGH=20,ADDRESS_LOW=21,POINTER_INDEX=22, + POINTER_HIGH=23,POINTER_LOW=24,INDEX_VALUE=25,ADDRESS_READY=26, + MOVD_INDEX=27,LOAD_VALUE=28,STORE_VALUE=29,CMP_VALUE=30, + PUSH_HIGH=31,PUSH_LOW=32,AFTER_PUSH=33,VECTOR_HIGH=34,VECTOR_LOW=35, + POP_VALUE=36,RETURN_LOW=37,RETURN_HIGH=38,RETURN_STATUS=39, + LDSP_VALUE=40,FINISH=41,WAIT_RELEASE=42,BUS_WAIT=43,BUS_RELEASE=44, + IRQ_PUSH_PC=45,ALU_COMMIT=46,MULTIPLY_COMMIT=47,DECIMAL_WAIT=48,DECIMAL_COMMIT=49, + DISPATCH=50; +reg [6:0] state,return_state; +reg [7:0] opcode,value,source_value,destination_value,high_byte,low_byte; +reg [5:0] operation; +reg [4:0] mode; +reg [15:0] destination_address,effective_address,pair_value,return_pc,vector_address; +reg [7:0] pointer_index; +reg branch_taken,is_reset,is_interrupt,destination_peripheral; +reg [15:0] product,saved_result; +reg [7:0] saved_status; +reg saved_write,saved_branch; +reg [5:0] saved_extra; +wire [5:0] decoded_operation,decoded_cycles; +wire [4:0] decoded_mode; +ssc_tms7000_decode decoder(opcode,decoded_operation,decoded_mode,decoded_cycles); +wire [15:0] alu_result; +wire [7:0] alu_status; +wire alu_write,alu_branch; +wire [5:0] alu_extra; +wire [7:0] decimal_add,decimal_sub; +wire decimal_add_carry,decimal_sub_carry; +wire [7:0] decimal_result=(operation==OP_DAC)?decimal_add:decimal_sub; +ssc_tms7000_bcd decimal_unit(clk,reset,destination_value,source_value,status[7], + decimal_add,decimal_sub,decimal_add_carry,decimal_sub_carry); +ssc_tms7000_alu arithmetic(operation, + (operation==OP_DECD)?pair_value:{8'd0,destination_value},source_value,status, + alu_result,alu_status,alu_write,alu_branch,alu_extra); + +task read_memory(input [15:0] address,input [6:0] continuation); + begin mem_request<=1;mem_write<=0;mem_peripheral<=0;mem_address<=address;mem_write_data<=0; + return_state<=continuation;state<=BUS_WAIT;end +endtask +task write_memory(input [15:0] address,input [7:0] data,input [6:0] continuation); + begin mem_request<=1;mem_write<=1;mem_peripheral<=0;mem_address<=address;mem_write_data<=data; + return_state<=continuation;state<=BUS_WAIT;end +endtask +task immediate(input [6:0] continuation); + begin read_memory(pc,continuation);pc<=pc+16'd1;end +endtask +function [15:0] previous_register(input [15:0] address); + begin previous_register={8'd0,(address[7:0]-8'd1)};end +endfunction +always @(posedge clk) begin + if(reset) begin + state<=RESET_START;return_state<=WAIT_STEP;mem_request<=0;mem_write<=0;mem_peripheral<=0; + mem_address<=0;mem_write_data<=0;initialized<=0;done<=0;irq_ack<=0; + pc<=0;sp<=8'hff;status<=0;idle<=0;illegal_count<=0;cycles<=0; + opcode<=0;value<=0;source_value<=0;destination_value<=0;high_byte<=0;low_byte<=0; + operation<=OP_BAD;mode<=AM_NONE;destination_address<=0;effective_address<=0; + pair_value<=0;return_pc<=0;vector_address<=0;pointer_index<=0; + branch_taken<=0;is_reset<=1;is_interrupt<=0;destination_peripheral<=0; + product<=0;saved_result<=0;saved_status<=0;saved_write<=0;saved_branch<=0;saved_extra<=0; + end else begin + irq_ack<=0; + // No operation-dependent operand mux before the physical multiplier. + product<=destination_value*source_value; + case(state) + RESET_START:begin + initialized<=0;done<=0; + return_pc<=pc+{15'd0,idle};sp<=8'hff;status<=0;idle<=0; + opcode<=8'hff;vector_address<=16'hfffe;is_reset<=1;is_interrupt<=0; + cycles<=17;state<=PUSH_HIGH; + end + WAIT_STEP:begin + done<=0; + if(restart) state<=RESET_START; + else if(step) begin + is_reset<=0;is_interrupt<=0; + if(irq_valid && status[4] && irq_index<3) begin + irq_ack<=1;is_interrupt<=1;cycles<=idle?7'd17:7'd19; + vector_address<=16'hfffc-{13'd0,irq_index,1'b0}; + return_pc<=pc+{15'd0,idle};idle<=0; + sp<=sp+8'd1;write_memory({8'd0,(sp+8'd1)},status,IRQ_PUSH_PC);status<=0; + end else immediate(FETCHED); + end + end + FETCHED:begin opcode<=value;state<=DECODE;end + DECODE:begin + operation<=decoded_operation;mode<=decoded_mode;cycles<={1'b0,decoded_cycles}; + branch_taken<=0;destination_peripheral<=0; + state<=DISPATCH; + end + DISPATCH:begin + case(mode) + AM_R_A,AM_R_B,AM_R_R,AM_P_A,AM_P_B:immediate(SRC_INDEX); + AM_I_A,AM_I_B,AM_I_R,AM_I_P:immediate(SRC_VALUE); + AM_A_A,AM_A_B,AM_A_R,AM_A_P:read_memory(0,SRC_VALUE); + AM_B_A,AM_B_B,AM_B_R,AM_B_P:read_memory(1,SRC_VALUE); + AM_A,AM_B,AM_R:state<=UNARY_START; + AM_DIR,AM_IND,AM_INX:state<=ADDRESS_START; + default:case(operation) + OP_BAD:begin illegal_count<=illegal_count+1'b1;state<=FINISH;end + OP_NOP:state<=FINISH; + OP_IDLE:begin pc<=pc-16'd1;idle<=1;state<=FINISH;end + OP_EINT:begin status<=status|8'hf0;state<=FINISH;end + OP_DINT:begin status<=status&8'h0f;state<=FINISH;end + OP_SETC:begin status<=(status&8'hbf)|8'ha0;state<=FINISH;end + OP_STSP:write_memory(1,sp,FINISH); + OP_LDSP:read_memory(1,LDSP_VALUE); + OP_PUSHST:begin sp<=sp+8'd1;write_memory({8'd0,(sp+8'd1)},status,FINISH);end + OP_POPST:begin read_memory({8'd0,sp},RETURN_STATUS);sp<=sp-8'd1;end + OP_RETS,OP_RETI:begin read_memory({8'd0,sp},RETURN_LOW);sp<=sp-8'd1;end + OP_TRAP:begin + return_pc<=pc;vector_address<={8'hff,opcode[6:0],1'b0};state<=PUSH_HIGH; + end + OP_JUMP:begin + case(opcode[2:0]) + 0:branch_taken<=1;1:branch_taken<=status[6];2:branch_taken<=status[5];3:branch_taken<=status[7]; + 4:branch_taken<=!(status[5]||status[6]);5:branch_taken<=!status[6];6:branch_taken<=!status[5];7:branch_taken<=!status[7]; + endcase + state<=BRANCH_START; + end + default:state<=FINISH; + endcase + endcase + end + SRC_INDEX:begin + read_memory((mode==AM_P_A||mode==AM_P_B)?{8'h01,value}:{8'd0,value},SRC_VALUE); + mem_peripheral<=(mode==AM_P_A||mode==AM_P_B); + end + SRC_VALUE:begin source_value<=value;state<=DEST_START;end + DEST_START:case(mode) + AM_R_A,AM_I_A,AM_B_A,AM_P_A,AM_A_A:begin destination_address<=0;read_memory(0,DEST_VALUE);end + AM_R_B,AM_I_B,AM_P_B,AM_A_B,AM_B_B:begin destination_address<=1;read_memory(1,DEST_VALUE);end + default:immediate(DEST_INDEX); + endcase + DEST_INDEX:begin + destination_address<=(mode==AM_A_P||mode==AM_B_P||mode==AM_I_P)?{8'h01,value}:{8'd0,value}; + destination_peripheral<=(mode==AM_A_P||mode==AM_B_P||mode==AM_I_P); + read_memory((mode==AM_A_P||mode==AM_B_P||mode==AM_I_P)?{8'h01,value}:{8'd0,value},DEST_VALUE); + mem_peripheral<=(mode==AM_A_P||mode==AM_B_P||mode==AM_I_P); + end + DEST_VALUE:begin destination_value<=value;state<=ALU;end + UNARY_START:begin + if(mode==AM_R) immediate(UNARY_INDEX); + else begin destination_address<=(mode==AM_A)?16'd0:16'd1;state<=UNARY_INDEX;value<=(mode==AM_A)?8'd0:8'd1;end + end + UNARY_INDEX:begin + destination_address<={8'd0,value}; + if(operation==OP_POP) begin read_memory({8'd0,sp},POP_VALUE);sp<=sp-8'd1;end + else if(operation==OP_DECD) read_memory({8'd0,(value-8'd1)},PAIR_HIGH); + else read_memory({8'd0,value},(operation==OP_PUSH)?STORE_VALUE:DEST_VALUE); + end + PAIR_HIGH:begin high_byte<=value;read_memory(destination_address,PAIR_LOW);end + PAIR_LOW:begin pair_value<={high_byte,value};state<=ALU;end + XCH_VALUE:begin source_value<=value;state<=ALU;end + ALU:begin + if(operation==OP_XCHB && mode!=AM_NONE) begin + mode<=AM_NONE;read_memory(1,XCH_VALUE); + end else if(operation==OP_MPY) state<=MULTIPLY_COMMIT; + else if(operation==OP_DAC||operation==OP_DSB) state<=DECIMAL_WAIT; + else begin + saved_result<=alu_result;saved_status<=alu_status;saved_write<=alu_write; + saved_branch<=alu_branch;saved_extra<=alu_extra;state<=ALU_COMMIT; + end + end + MULTIPLY_COMMIT:begin + status<={1'b0,product[15],(product[15:8]==0),status[4:0]}; + pair_value<=product;cycles<=cycles+7'd39;destination_address<=1; + write_memory(0,product[15:8],WRITE_PAIR_LOW); + end + DECIMAL_WAIT:state<=DECIMAL_COMMIT; + DECIMAL_COMMIT:begin + status<={((operation==OP_DAC)?decimal_add_carry:decimal_sub_carry), + decimal_result[7],(decimal_result==0),status[4:0]}; + cycles<=cycles+7'd2; + write_memory(destination_address,decimal_result,FINISH);mem_peripheral<=destination_peripheral; + end + ALU_COMMIT:begin + status<=saved_status;pair_value<=saved_result;branch_taken<=saved_branch; + cycles<=cycles+{1'b0,saved_extra}; + if(operation==OP_DECD) write_memory(previous_register(destination_address),saved_result[15:8],WRITE_PAIR_LOW); + else if(operation==OP_XCHB) write_memory(1,destination_value,WRITE_RESULT); + // DJNZ consumes displacement BEFORE writing its decremented operand. + // This matters when PC wraps into RF and the two addresses alias. + else if(operation==OP_DJNZ) state<=BRANCH_START; + else if(saved_write) begin write_memory(destination_address,saved_result[7:0],BRANCH_START);mem_peripheral<=destination_peripheral;end + else state<=BRANCH_START; + end + WRITE_RESULT:begin write_memory(destination_address,pair_value[7:0],BRANCH_START);mem_peripheral<=destination_peripheral;end + WRITE_PAIR_LOW:write_memory(destination_address,pair_value[7:0],BRANCH_START); + BRANCH_START:begin + if(operation==OP_JUMP) begin cycles<=cycles+(branch_taken?7'd4:7'd2);immediate(BRANCH_VALUE);end + else if(operation==OP_BTJO||operation==OP_BTJZ||operation==OP_DJNZ) immediate(BRANCH_VALUE); + else state<=FINISH; + end + BRANCH_VALUE:begin + if(branch_taken) pc<=pc+{{8{value[7]}},value}; + if(operation==OP_DJNZ) write_memory(destination_address,pair_value[7:0],FINISH); + else state<=FINISH; + end + ADDRESS_START:begin if(mode==AM_IND) immediate(POINTER_INDEX);else immediate(ADDRESS_HIGH);end + ADDRESS_HIGH:begin high_byte<=value;immediate(ADDRESS_LOW);end + ADDRESS_LOW:begin + effective_address<={high_byte,value}; + if(mode==AM_INX) read_memory(1,INDEX_VALUE);else state<=ADDRESS_READY; + end + POINTER_INDEX:begin pointer_index<=value;read_memory({8'd0,(value-8'd1)},POINTER_HIGH);end + POINTER_HIGH:begin high_byte<=value;read_memory({8'd0,pointer_index},POINTER_LOW);end + POINTER_LOW:begin effective_address<={high_byte,value};state<=ADDRESS_READY;end + INDEX_VALUE:begin effective_address<=effective_address+{8'd0,value};state<=ADDRESS_READY;end + ADDRESS_READY:case(operation) + OP_MOVD:immediate(MOVD_INDEX); + OP_LDA:read_memory(effective_address,LOAD_VALUE); + OP_STA:read_memory(0,STORE_VALUE); + OP_CMPA:read_memory(effective_address,CMP_VALUE); + OP_BR:begin pc<=effective_address;state<=FINISH;end + OP_CALL:begin return_pc<=pc;state<=PUSH_HIGH;end + default:state<=FINISH; + endcase + MOVD_INDEX:begin + destination_address<={8'd0,value};pair_value<=effective_address; + status<={1'b0,effective_address[15],(effective_address[15:8]==0),status[4:0]}; + write_memory({8'd0,(value-8'd1)},effective_address[15:8],WRITE_PAIR_LOW); + end + LOAD_VALUE:begin + status<={1'b0,value[7],(value==0),status[4:0]};write_memory(0,value,FINISH); + end + STORE_VALUE:begin + status<={1'b0,value[7],(value==0),status[4:0]}; + if(operation==OP_PUSH) begin sp<=sp+8'd1;write_memory({8'd0,(sp+8'd1)},value,FINISH);end + else write_memory(effective_address,value,FINISH); + end + CMP_VALUE:begin source_value<=value;operation<=OP_CMP;read_memory(0,DEST_VALUE);end + PUSH_HIGH:begin sp<=sp+8'd1;write_memory({8'd0,(sp+8'd1)},return_pc[15:8],PUSH_LOW);end + PUSH_LOW:begin sp<=sp+8'd1;write_memory({8'd0,(sp+8'd1)},return_pc[7:0],AFTER_PUSH);end + AFTER_PUSH:begin + if(operation==OP_CALL && !is_reset && !is_interrupt) begin pc<=effective_address;state<=FINISH;end + else read_memory(vector_address,VECTOR_HIGH); + end + VECTOR_HIGH:begin high_byte<=value;read_memory(vector_address+16'd1,VECTOR_LOW);end + VECTOR_LOW:begin pc<={high_byte,value};state<=FINISH;end + IRQ_PUSH_PC:state<=PUSH_HIGH; + POP_VALUE:begin + status<={1'b0,value[7],(value==0),status[4:0]};write_memory(destination_address,value,FINISH); + end + RETURN_LOW:begin low_byte<=value;read_memory({8'd0,sp},RETURN_HIGH);sp<=sp-8'd1;end + RETURN_HIGH:begin + pc<={value,low_byte}; + if(operation==OP_RETI) begin read_memory({8'd0,sp},RETURN_STATUS);sp<=sp-8'd1;end + else state<=FINISH; + end + RETURN_STATUS:begin status<=value&8'hf0;state<=FINISH;end + LDSP_VALUE:begin sp<=value;state<=FINISH;end + FINISH:begin + if(is_reset) begin initialized<=1;state<=WAIT_STEP;end + else begin done<=1;state<=WAIT_RELEASE;end + end + WAIT_RELEASE:if(!step) begin done<=0;state<=WAIT_STEP;end + BUS_WAIT:if(mem_ready) begin value<=mem_read_data;mem_request<=0;state<=BUS_RELEASE;end + BUS_RELEASE:if(!mem_ready) state<=return_state; + default:state<=RESET_START; + endcase + end +end +endmodule diff --git a/rtl/ssc/ssc_tms7000_io.sv b/rtl/ssc/ssc_tms7000_io.sv new file mode 100644 index 0000000..d8588c8 --- /dev/null +++ b/rtl/ssc/ssc_tms7000_io.sv @@ -0,0 +1,132 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// PIC7040 peripherals. VCCPlus/MAME hap, Tim Lindner; notices in LICENSE. +// TI SPND001A sections 2.2,2.5,2.6 govern DDR updates, latched/level IRQs, +// and immediate automatic timer reload, where the software reference differs. +// icount_tick is one phi clock (PIC input clock /2), NOT one fabric clock. +// GPIO uses captured held requests. Input/high-impedance output bits are zero +// on this digital glue interface; this does not model external pull resistors. +module ssc_tms7000_io(input wire clk,reset,soft_reset, + output reg initialized, + input wire request,write,input wire [7:0] address,write_data, + output reg ready,output reg [7:0] read_data, + input wire icount_tick,irq1,irq3,timer_external, + input wire irq_ack,input wire [1:0] irq_ack_index, + output wire irq_valid,output wire [1:0] irq_index, + output reg gpio_request,gpio_write,output reg [1:0] gpio_port, + output reg [7:0] gpio_write_data,input wire gpio_ready,input wire [7:0] gpio_read_data); +localparam [3:0] RESET_BEGIN=0,RESET_C=1,RESET_D=2,RESET_END=3,IDLE=4, + EXECUTE=5,READ_GPIO=6,COMPLETE=7,WAIT_RELEASE=8,GPIO_WAIT=9,GPIO_RELEASE=10; +reg [3:0] state,continuation; +reg access_write; +reg [7:0] access_address,access_data,gpio_value; +reg [7:0] latch_b,latch_c,latch_d,ddr_c,ddr_d; +reg [2:0] irq_enable,irq_latched; +reg [1:0] mode_bits; +reg previous_irq1,previous_irq3,previous_external; +reg [7:0] timer_data,timer_control,timer_current,timer_capture; +reg [4:0] timer_prescale; +reg [2:0] timer_divider; +reg timer_running; +wire [2:0] flags=irq_latched|{irq3,1'b0,irq1}; +wire [2:0] pending=flags&irq_enable; +assign irq_valid=|pending; +assign irq_index=pending[0]?2'd0:pending[1]?2'd1:2'd2; +wire timer_event=timer_running && icount_tick && + (timer_control[6]?(timer_external && !previous_external):(timer_divider==3'd7)); +wire pf_write=state==EXECUTE && access_write; +task gpio(input w,input [1:0] port,input [7:0] data,input [3:0] next); + begin gpio_request<=1;gpio_write<=w;gpio_port<=port;gpio_write_data<=data; + continuation<=next;state<=GPIO_WAIT;end +endtask +always @(posedge clk)begin + if(reset)begin + state<=RESET_BEGIN;continuation<=IDLE;initialized<=0;ready<=0;read_data<=0; + access_write<=0;access_address<=0;access_data<=0;gpio_value<=0; + gpio_request<=0;gpio_write<=0;gpio_port<=0;gpio_write_data<=0; + latch_b<=0;latch_c<=0;latch_d<=0;ddr_c<=0;ddr_d<=0; + irq_enable<=0;irq_latched<=0;mode_bits<=0;previous_irq1<=0;previous_irq3<=0; + previous_external<=0;timer_data<=0;timer_control<=0;timer_current<=0; + timer_capture<=0;timer_prescale<=0;timer_divider<=0;timer_running<=0; + end else begin + previous_irq1<=irq1;previous_irq3<=irq3; + if(icount_tick)previous_external<=timer_external; + if(irq_ack && irq_ack_index<3)irq_latched[irq_ack_index]<=0; + // Pulse latches survive deassertion; active levels remain visible after ack. + // New assertions win over software clears/ack on the same fabric edge. + if(irq1 && !previous_irq1)irq_latched[0]<=1; + if(irq3 && !previous_irq3)begin irq_latched[2]<=1;timer_capture<=timer_current;end + if(initialized && timer_running && icount_tick && !timer_control[6]) + timer_divider<=timer_divider+3'd1; + if(initialized && timer_event)begin + if(timer_prescale==0)begin + timer_prescale<=timer_control[4:0]; + if(timer_current==0)begin timer_current<=timer_data;irq_latched[1]<=1;end + else timer_current<=timer_current-8'd1; + end else timer_prescale<=timer_prescale-5'd1; + end + case(state) + RESET_BEGIN:begin + initialized<=0;ready<=0;irq_enable<=0;mode_bits<=0;timer_running<=0; + latch_b<=8'hff;latch_c<=8'hff;latch_d<=8'hff;ddr_c<=0;ddr_d<=0; + if(!gpio_ready)gpio(1,1,8'hff,RESET_C); + end + RESET_C:gpio(1,2,0,RESET_D); + RESET_D:gpio(1,3,0,RESET_END); + RESET_END:begin initialized<=1;state<=IDLE;end + IDLE:begin + if(soft_reset)state<=RESET_BEGIN; + else if(request)begin access_write<=write;access_address<=address; + access_data<=write_data;state<=EXECUTE;end + end + EXECUTE:begin + if(access_write)begin + case(access_address) + 0:begin + irq_enable<={access_data[4],access_data[2],access_data[0]};mode_bits<=access_data[7:6]; + if(access_data[1])irq_latched[0]<=irq1 && !previous_irq1; + if(access_data[3])irq_latched[1]<=initialized && timer_event && timer_prescale==0 && timer_current==0; + if(access_data[5])irq_latched[2]<=irq3 && !previous_irq3; + state<=COMPLETE; + end + 2:begin timer_data<=access_data;state<=COMPLETE;end + 3:begin + timer_control<=access_data;timer_running<=access_data[7]; + if(access_data[7])begin timer_current<=timer_data;timer_prescale<=access_data[4:0];timer_divider<=0;end + state<=COMPLETE; + end + 6:begin latch_b<=access_data;gpio(1,1,access_data,COMPLETE);end + 8:begin latch_c<=access_data;gpio(1,2,access_data&ddr_c,COMPLETE);end + 9:begin ddr_c<=access_data;gpio(1,2,latch_c&access_data,COMPLETE);end + 10:begin latch_d<=access_data;gpio(1,3,access_data&ddr_d,COMPLETE);end + 11:begin ddr_d<=access_data;gpio(1,3,latch_d&access_data,COMPLETE);end + default:state<=COMPLETE; + endcase + end else case(access_address) + 0:begin read_data<={mode_bits,flags[2],irq_enable[2],flags[1],irq_enable[1],flags[0],irq_enable[0]};state<=COMPLETE;end + 2:begin read_data<=timer_current;state<=COMPLETE;end + 3:begin read_data<=timer_capture;state<=COMPLETE;end + 4:gpio(0,0,0,READ_GPIO); + 6:begin read_data<=latch_b;state<=COMPLETE;end + 8:gpio(0,2,0,READ_GPIO); + 9:begin read_data<=ddr_c;state<=COMPLETE;end + 10:gpio(0,3,0,READ_GPIO); + 11:begin read_data<=ddr_d;state<=COMPLETE;end + default:begin read_data<=0;state<=COMPLETE;end + endcase + end + READ_GPIO:begin + read_data<=(access_address==4)?gpio_value:(access_address==8)? + ((gpio_value&~ddr_c)|(latch_c&ddr_c)):((gpio_value&~ddr_d)|(latch_d&ddr_d)); + state<=COMPLETE; + end + COMPLETE:begin ready<=1;state<=WAIT_RELEASE;end + WAIT_RELEASE:if(!request)begin ready<=0;state<=IDLE;end + GPIO_WAIT:if(gpio_ready)begin gpio_value<=gpio_read_data;gpio_request<=0;state<=GPIO_RELEASE;end + GPIO_RELEASE:if(!gpio_ready)state<=continuation; + default:state<=RESET_BEGIN; + endcase + end +end +endmodule diff --git a/rtl/ssc/ssc_tms7000_memory.sv b/rtl/ssc/ssc_tms7000_memory.sv new file mode 100644 index 0000000..54447d2 --- /dev/null +++ b/rtl/ssc/ssc_tms7000_memory.sv @@ -0,0 +1,70 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Single-chip PIC7040 RF/ROM map and peripheral bus adapter. See LICENSE. +// ROM is volatile, sequentially loaded 0..4095 after rom_begin. No ROM bytes +// are built into this source. A malformed load invalidates the image. +module ssc_tms7000_memory(input wire clk,reset, + input wire rom_begin,rom_write,input wire [11:0] rom_address,input wire [7:0] rom_data, + output reg rom_loaded,load_error,output reg initialized, + input wire request,write,peripheral,input wire [15:0] address,input wire [7:0] write_data, + output reg ready,output reg [7:0] read_data, + output reg pf_request,pf_write,output reg [7:0] pf_address,pf_write_data, + input wire pf_ready,input wire [7:0] pf_read_data); +localparam [2:0] IDLE=0,EXECUTE=1,READ_RETURN=2,PF_WAIT=3,PF_RELEASE=4,WAIT_RELEASE=5; +reg [2:0] state; +reg [7:0] rf[0:127],rom[0:4095]; +reg [7:0] rf_read,rom_read; +reg [6:0] clear_address; +reg [15:0] access_address; +reg [7:0] access_data; +reg access_write,access_peripheral,loading; +reg [11:0] expected_address; +wire rf_store=initialized && !rom_begin && state==EXECUTE && access_write && access_address<128 && !access_peripheral; +wire rom_store=!reset && !rom_begin && rom_write && loading && !load_error && rom_address==expected_address; +always @(posedge clk)begin + rf_read<=rf[access_address[6:0]];rom_read<=rom[access_address[11:0]]; + if(!reset && !initialized)rf[clear_address]<=0; + else if(!reset && rf_store)rf[access_address[6:0]]<=access_data; + if(rom_store)rom[rom_address]<=rom_data; +end +always @(posedge clk)begin + if(reset)begin + initialized<=0;clear_address<=0;state<=IDLE;ready<=0;read_data<=0; + access_address<=0;access_data<=0;access_write<=0;access_peripheral<=0; + pf_request<=0;pf_write<=0;pf_address<=0;pf_write_data<=0; + rom_loaded<=0;load_error<=0;loading<=0;expected_address<=0; + end else begin + if(!initialized)begin + if(clear_address==127)initialized<=1;else clear_address<=clear_address+7'd1; + end + if(rom_begin)begin rom_loaded<=0;load_error<=0;loading<=1;expected_address<=0;end + else if(rom_write)begin + if(!loading || load_error || rom_address!=expected_address)begin rom_loaded<=0;load_error<=1;loading<=0;end + else if(expected_address==4095)begin rom_loaded<=1;loading<=0;end + else expected_address<=expected_address+12'd1; + end + if(rom_begin)begin state<=IDLE;ready<=0;pf_request<=0;end + else case(state) + IDLE:if(initialized && request)begin + access_address<=address;access_data<=write_data;access_write<=write;access_peripheral<=peripheral; + state<=EXECUTE; + end + EXECUTE:begin + if(access_peripheral || (access_address>=16'h100 && access_address<16'h10c))begin + pf_request<=1;pf_write<=access_write;pf_address<=access_address[7:0];pf_write_data<=access_data;state<=PF_WAIT; + end else state<=READ_RETURN; + end + READ_RETURN:begin + read_data<=access_address<128?rf_read:access_address<256?8'h00: + access_address>=16'hf000 ? rom_read:8'hff; + ready<=1;state<=WAIT_RELEASE; + end + PF_WAIT:if(pf_ready)begin read_data<=pf_read_data;pf_request<=0;state<=PF_RELEASE;end + PF_RELEASE:if(!pf_ready)begin ready<=1;state<=WAIT_RELEASE;end + WAIT_RELEASE:if(!request)begin ready<=0;state<=IDLE;end + default:state<=IDLE; + endcase + end +end +endmodule diff --git a/rtl/ssc/ssc_tms7000_pacer.sv b/rtl/ssc/ssc_tms7000_pacer.sv new file mode 100644 index 0000000..2ad29f4 --- /dev/null +++ b/rtl/ssc/ssc_tms7000_pacer.sv @@ -0,0 +1,43 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +// SPDX-License-Identifier: BSD-3-Clause +// Instruction-boundary scheduler. icount_tick is PIC input clock /2. +// Start-to-start intervals equal reported architectural cycles. An engine or +// peripheral response that misses its deadline sets overrun and stops launches. +// run may fall during a transaction; quiescent follows its completed budget. +module ssc_tms7000_pacer(input wire clk,reset,run,icount_tick, + input wire engine_done,input wire [6:0] engine_cycles, + output reg step,output wire quiescent,output reg overrun); +localparam [1:0] IDLE=0,EXECUTE=1,RELEASE=2,BUDGET=3; +reg [1:0] state; +reg [7:0] elapsed; +reg [6:0] budget; +wire [8:0] next_elapsed={1'b0,elapsed}+{8'd0,icount_tick}; +assign quiescent=state==IDLE && !step; +always @(posedge clk)begin + if(reset)begin state<=IDLE;step<=0;overrun<=0;elapsed<=0;budget<=0;end + else begin + if(state!=IDLE && icount_tick && elapsed!=255)elapsed<=elapsed+8'd1; + // A nonresponding bus must be observable even if engine_done never arrives. + // Original instructions take at most49 icount ticks. Do not abort a captured + // bus operation; latch the fault and require reset if it cannot complete. + if(state==EXECUTE && next_elapsed>=9'd127)overrun<=1; + case(state) + IDLE:if(run && icount_tick && !overrun)begin step<=1;elapsed<=0;state<=EXECUTE;end + EXECUTE:if(engine_done)begin + step<=0;budget<=engine_cycles;state<=RELEASE; + if(next_elapsed>={2'd0,engine_cycles})overrun<=1; + end + RELEASE:if(!engine_done)begin + state<=BUDGET; + if(next_elapsed>={2'd0,budget})overrun<=1; + end + BUDGET:if(icount_tick && next_elapsed>={2'd0,budget})begin + if(run && !overrun)begin step<=1;elapsed<=0;state<=EXECUTE;end + else state<=IDLE; + end + default:state<=IDLE; + endcase + end +end +endmodule diff --git a/scripts/bh_mpi_timing.tcl b/scripts/bh_mpi_timing.tcl new file mode 100644 index 0000000..28f31da --- /dev/null +++ b/scripts/bh_mpi_timing.tcl @@ -0,0 +1,35 @@ +# quartus_sta -t bh_mpi_timing.tcl PROJECT REVISION OUTPUT +package require ::quartus::project +package require ::quartus::sta +set project [file normalize [lindex $quartus(args) 0]] +set revision [lindex $quartus(args) 1] +set output [file normalize [lindex $quartus(args) 2]] +file mkdir $output +cd [file dirname $project] +project_open [file tail $project] -revision $revision +foreach model {slow fast} { + create_timing_netlist -model $model + read_sdc + update_timing_netlist + foreach {scope pattern} { + config {*mpi_configuration|*} + rom {*mpi_program_roms|*} + banks {*rom_banks*} + restart {*mpi_rom_cold_pending*} + } { + set nodes [get_keepers $pattern] + set count [get_collection_size $nodes] + puts "BH_MPI_SCOPE $model $scope $count" + if {$count==0} {error "Missing new MPI state scope: $scope"} + foreach check {setup hold} { + report_timing -$check -to $nodes -npaths 20 -detail full_path \ + -file [file join $output ${scope}-to-${model}-${check}.rpt] + report_timing -$check -from $nodes -npaths 20 -detail full_path \ + -file [file join $output ${scope}-from-${model}-${check}.rpt] + } + } + report_timing -setup -npaths 30 -detail full_path \ + -file [file join $output global-${model}-setup.rpt] + delete_timing_netlist +} +project_close diff --git a/scripts/coco3_bh_profile.py b/scripts/coco3_bh_profile.py new file mode 100644 index 0000000..536c928 --- /dev/null +++ b/scripts/coco3_bh_profile.py @@ -0,0 +1,15 @@ +"""Coco 3 Plus deployment paths and native MiSTer remembered-file records.""" +NAME = 'coco3plus' +GAME_DIR = '/media/fat/games/' + NAME +ROM_SLOTS = {4: 'pic-7040-510.bin', 5: 'sp0256-al2.bin'} + + +def startup_records(): + # Match MiSTer menu.cpp's 1024-byte, NUL-terminated selPath buffer. + records = {} + for slot, name in ROM_SLOTS.items(): + path = (GAME_DIR + '/' + name).encode('ascii') + if len(path) >= 1024: + raise ValueError('Startup path does not fit MiSTer selPath') + records[f'config/{NAME}.f{slot}'] = path.ljust(1024, b'\0') + return records diff --git a/scripts/external_io_timing.tcl b/scripts/external_io_timing.tcl new file mode 100644 index 0000000..8e4da3f --- /dev/null +++ b/scripts/external_io_timing.tcl @@ -0,0 +1,72 @@ +# Read-only fitted-design audit. Optional last argument is an experimental SDC. +# quartus_sta -t SCRIPT PROJECT REVISION OUTPUT [EXTRA_SDC] +package require ::quartus::project +package require ::quartus::sta +set project [file normalize [lindex $quartus(args) 0]] +set revision [lindex $quartus(args) 1] +set output [file normalize [lindex $quartus(args) 2]] +set extra [lindex $quartus(args) 3] +set mode [lindex $quartus(args) 4] +file mkdir $output +cd [file dirname $project] +project_open [file tail $project] -revision $revision +if {$mode eq "replace-external"} { + # In-memory settings only: retrospective analysis of an identical fitted + # netlist with a corrected constraint guard. Never export these assignments. + set_global_assignment -remove -name SDC_FILE external-io.sdc + set_global_assignment -name SDC_FILE $extra + set f [open [file join $output constraint-override.txt] w] + puts $f $extra + close $f + set extra "" +} +foreach model {slow fast} { + create_timing_netlist -model $model + read_sdc + if {$extra ne ""} {read_sdc $extra} + update_timing_netlist + foreach {name pattern} { + sdram_dq {SDRAM_DQ[*]} + sdram_command {SDRAM_A[*] SDRAM_BA[*] SDRAM_n* SDRAM_DQM*} + hdmi_video {HDMI_TX_D[*] HDMI_TX_DE HDMI_TX_HS HDMI_TX_VS} + hdmi_audio {HDMI_I2S HDMI_LRCLK HDMI_SCLK} + mcp_i2c {IO_SDA IO_SCL} + } { + set ports [get_ports $pattern] + puts "EXTERNAL_IO_SCOPE $model $name [get_collection_size $ports]" + foreach check {setup hold} { + report_timing -$check -from $ports -npaths 32 -detail full_path -file [file join $output ${name}-in-${model}-${check}.rpt] + report_timing -$check -to $ports -npaths 40 -detail full_path -file [file join $output ${name}-out-${model}-${check}.rpt] + } + } + foreach {mode launch latch} { + scaled {pll_hdmi|pll_hdmi_inst|altera_pll_i|cyclonev_pll|counter[0].output_counter|divclk} hdmi_scaled_forward + direct {emu|pll|pll_inst|altera_pll_i|general[1].gpll~PLL_OUTPUT_COUNTER|divclk} hdmi_direct_forward + } { + if {[get_collection_size [get_clocks $latch]] == 1} { + foreach check {setup hold} { + report_timing -$check -from_clock [get_clocks $launch] -to_clock [get_clocks $latch] -to [get_ports {HDMI_TX_D[*] HDMI_TX_DE HDMI_TX_HS HDMI_TX_VS}] -npaths 40 -detail full_path -file [file join $output hdmi-${mode}-${model}-${check}.rpt] + } + } + } + if {[get_collection_size [get_clocks coco_pixel]] == 1} { + foreach check {setup hold} { + report_timing -$check -from_clock [get_clocks coco_pixel] -npaths 40 -detail full_path -file [file join $output pixel-out-${model}-${check}.rpt] + report_timing -$check -to_clock [get_clocks coco_pixel] -npaths 40 -detail full_path -file [file join $output pixel-in-${model}-${check}.rpt] + } + } + foreach check {setup hold recovery removal} { + report_timing -$check -npaths 40 -detail full_path -file [file join $output global-${model}-${check}.rpt] + } + if {$model eq "slow"} { + report_clocks -file [file join $output clocks.rpt] + report_ucp -file [file join $output unconstrained.rpt] + report_exceptions -file [file join $output exceptions.rpt] + report_clock_transfers -setup -file [file join $output transfers.rpt] + set f [open [file join $output clock-nodes.txt] w] + foreach_in_collection n [get_pins -hierarchical {*divclk* *MISTER_COCOVID*PIX_CLK* *sdramclk_ddr*}] {puts $f [get_node_info -name $n]} + close $f + } + delete_timing_netlist +} +project_close -dont_export_assignments diff --git a/scripts/nmi_timing_paths.tcl b/scripts/nmi_timing_paths.tcl new file mode 100644 index 0000000..486d7d1 --- /dev/null +++ b/scripts/nmi_timing_paths.tcl @@ -0,0 +1,60 @@ +# quartus_sta -t nmi_timing_paths.tcl PROJECT REVISION OUTPUT_DIRECTORY +package require ::quartus::project +package require ::quartus::sta +set project [lindex $quartus(args) 0] +set revision [lindex $quartus(args) 1] +set output [file normalize [lindex $quartus(args) 2]] +file mkdir $output +project_open $project -revision $revision +foreach model {slow fast} { + create_timing_netlist -model $model + read_sdc + update_timing_netlist + set nmi [get_registers {*GLBCPU09|NMI*}] + if {[get_collection_size $nmi] < 5} {error "Expected complete CPU NMI register scope"} + puts "NMI_REGISTERS $model [get_collection_size $nmi]" + set cpu [get_registers {*GLBCPU09|*}] + foreach check {setup hold} { + report_timing -$check -from $cpu -to $cpu -npaths 5 -detail full_path \ + -file [file join $output cpu-internal-${model}-${check}.rpt] + } + # Register-only endpoints would miss the effective mask/pending view. + # Kept combinational nets must also be covered through to CPU consumers. + if {[get_collection_size $nmi] > 5} { + foreach signal {NMIMask NMILatched} { + set through [get_nets *GLBCPU09|$signal] + if {[get_collection_size $through] == 0} {error "Missing kept NMI net $signal"} + puts "NMI_THROUGH $model $signal [get_collection_size $through]" + foreach check {setup hold} { + report_timing -$check -through $through -npaths 20 -detail full_path \ + -file [file join $output nmi-through-${signal}-${model}-${check}.rpt] + } + } + } + foreach check {setup hold recovery removal} { + report_timing -$check -to $nmi -npaths 20 -detail full_path \ + -file [file join $output nmi-in-${model}-${check}.rpt] + report_timing -$check -from $nmi -npaths 20 -detail full_path \ + -file [file join $output nmi-out-${model}-${check}.rpt] + report_timing -$check -npaths 5 -detail full_path \ + -file [file join $output global-${model}-${check}.rpt] + } + if {$model eq "slow"} { + set audit [open [file join $output nmi-register-clocks.tsv] w] + puts $audit "register\tclock_pin\tclock_driver" + foreach_in_collection reg $nmi { + foreach edge [get_register_info -clock_edges $reg] { + set pin [get_edge_info -src $edge] + foreach input_edge [get_node_info -clock_edges $pin] { + puts $audit "[get_register_info -name $reg]\t[get_node_info -name $pin]\t[get_node_info -name [get_edge_info -src $input_edge]]" + } + } + } + close $audit + report_clocks -file [file join $output clocks.rpt] + report_ucp -file [file join $output unconstrained.rpt] + report_clock_transfers -file [file join $output clock-transfers.rpt] + } + delete_timing_netlist +} +project_close diff --git a/scripts/reset_cpu_timing_paths.tcl b/scripts/reset_cpu_timing_paths.tcl new file mode 100644 index 0000000..e2d613d --- /dev/null +++ b/scripts/reset_cpu_timing_paths.tcl @@ -0,0 +1,79 @@ +# quartus_sta -t reset_cpu_timing_paths.tcl PROJECT REVISION OUTPUT_DIRECTORY +package require ::quartus::project +package require ::quartus::sta +set project [lindex $quartus(args) 0] +set revision [lindex $quartus(args) 1] +set output [file normalize [lindex $quartus(args) 2]] +file mkdir $output +project_open $project -revision $revision +foreach model {slow fast} { + create_timing_netlist -model $model + read_sdc + update_timing_netlist + set per_clock [file join $output per-clock-${model}-setup.rpt] + set empty [open $per_clock w] + close $empty + foreach_in_collection clock [get_clocks *] { + report_timing -setup -to_clock [get_clocks [list [get_clock_info -name $clock]]] \ + -npaths 2 -detail full_path -append -file $per_clock + } + set resets [get_registers {*coco3|RESET_N *coco3|RESET_RAW_N *coco3|CPU_RESET *coco3|reset_*release[*] *coco_fdc|wd_reset_release[*] *coco_sdc_top|wd_reset_release[*]}] + if {[get_collection_size $resets] < 4} {error "Incomplete reset sequencer scope"} + foreach check {setup hold recovery removal} { + report_timing -$check -from $resets -npaths 30 -detail full_path \ + -file [file join $output reset-${model}-${check}.rpt] + report_timing -$check -npaths 30 -detail full_path \ + -file [file join $output global-${model}-${check}.rpt] + } + set cpu [get_registers {*GLBCPU09|*}] + puts "CPU_REGISTERS $model [get_collection_size $cpu]" + set control [get_registers {*coco3|data_ready* *coco3|hold_data* *coco3|hold* *coco3|end_hold *coco3|cpu_cycle_ena *coco3|clear_data_ready *coco3|sdram_cpu_req *coco3|sdram_cpu_rnw *coco3|sdram_cpu_addr_L[*] *coco3|GART_RD *coco3|GART_WR *coco3|AMW_WR *coco3|RAM0_BE0_L *coco3|RAM0_BE1_L *coco3|sdram_BE_0 *coco3|sdram_BE_1 *coco3|last_write *coco3|CLK[*] *coco3|SWITCH_L[*]}] + set boot [get_registers {*COCO3_EE_Cold_Bt|*}] + set bridge [get_registers {*cpu_memory_boundary|*}] + foreach check {setup hold} { + report_timing -$check -to $cpu -npaths 30 -detail full_path \ + -file [file join $output cpu-in-${model}-${check}.rpt] + report_timing -$check -from $cpu -npaths 30 -detail full_path \ + -file [file join $output cpu-out-${model}-${check}.rpt] + report_timing -$check -to $control -npaths 30 -detail full_path \ + -file [file join $output control-in-${model}-${check}.rpt] + report_timing -$check -from $control -npaths 30 -detail full_path \ + -file [file join $output control-out-${model}-${check}.rpt] + report_timing -$check -from $cpu -to $cpu -npaths 30 -detail full_path \ + -file [file join $output cpu-all-${model}-${check}.rpt] + if {[info exists cpu_ce]} { + report_timing -$check -from $cpu_ce -to $cpu_ce -npaths 30 -detail full_path \ + -file [file join $output cpu-qualified-${model}-${check}.rpt] + } + report_timing -$check -to $boot -npaths 20 -detail full_path \ + -file [file join $output boot-${model}-${check}.rpt] + if {[get_collection_size $bridge] > 0} { + report_timing -$check -to $bridge -npaths 20 -detail full_path \ + -file [file join $output bridge-in-${model}-${check}.rpt] + report_timing -$check -from $bridge -npaths 20 -detail full_path \ + -file [file join $output bridge-out-${model}-${check}.rpt] + } + } + if {$model eq "slow"} { + set f [open [file join $output cpu-clock-audit.tsv] w] + puts $f "register\trole\tclock_pin\tclock_driver" + foreach_in_collection reg $cpu { + set name [get_register_info -name $reg] + regexp {GLBCPU09\|([A-Za-z_][A-Za-z_0-9]*)} $name unused base + set role single-cycle + if {[info exists cpu_ce_bases] && [lsearch -exact $cpu_ce_bases $base] >= 0} {set role qualified-enable} + foreach edge [get_register_info -clock_edges $reg] { + set pin [get_edge_info -src $edge] + foreach input_edge [get_node_info -clock_edges $pin] { + puts $f "$name\t$role\t[get_node_info -name $pin]\t[get_node_info -name [get_edge_info -src $input_edge]]" + } + } + } + close $f + report_clocks -file [file join $output clocks.rpt] + report_ucp -file [file join $output unconstrained.rpt] + report_exceptions -file [file join $output exceptions.rpt] + } + delete_timing_netlist +} +project_close diff --git a/scripts/rom_inputs.py b/scripts/rom_inputs.py new file mode 100644 index 0000000..ee9dc78 --- /dev/null +++ b/scripts/rom_inputs.py @@ -0,0 +1,15 @@ +import hashlib,zlib +ROM_IDENTITIES = { + 'pic-7040-510.bin': (4096, '0013cd78482cc5f2360fdf584e9ba51d34861e8ccd9d88247f1a54039c16c365', + '7c17dcbc21757535ce0b3a9e1ce5ca61319d3606', 'a8e2eb98'), + 'sp0256-al2.bin': (2048, '98c280fd082169c54081e503dfe7d7d9a6fd46d4ffcc973e199ea0e1d9bc1ac9', + 'e60fcb5fa16ff3f3b69d36c7a6e955744d3feafc', 'b504ac15'), +} + + +def verified_rom(path, identity): + size, sha256, sha1, crc = identity + data = path.read_bytes() + if len(data) != size or hashlib.sha256(data).hexdigest() != sha256 or hashlib.sha1(data).hexdigest() != sha1 or f'{zlib.crc32(data):08x}' != crc: + raise RuntimeError('Original ROM identity mismatch: ' + path.name) + return {'path': str(path), 'bytes': size, 'sha256': sha256, 'sha1': sha1, 'crc32': crc} diff --git a/scripts/run_regressions.py b/scripts/run_regressions.py new file mode 100644 index 0000000..ff9c3a6 --- /dev/null +++ b/scripts/run_regressions.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +"""Run independent MPI and inherited regressions against an isolated source copy. + +This does not compile Quartus, qualify timing, install a core, or test hardware. +Each test owns a fresh output folder and its source-hashed evidence. +""" +import argparse +from concurrent.futures import ThreadPoolExecutor, as_completed +import json +from pathlib import Path +import subprocess +import sys +import time + +ROOT = Path(__file__).resolve().parents[1] + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('project', type=Path, nargs='?', default=ROOT) + p.add_argument('--suite', type=Path, required=True) + p.add_argument('--main-reference', type=Path, required=True) + p.add_argument('--output',type=Path,default=ROOT/'build/regressions') + p.add_argument('--jobs', type=int, default=3, choices=range(1, 5)) + a = p.parse_args() + project = a.project.resolve() + if project != ROOT and not project.is_relative_to(ROOT / 'build'): + p.error('Use a prepared build/ project') + base = a.output.resolve() + if not base.is_relative_to(ROOT/'build'):p.error('Use an output under build/') + base.mkdir(parents=True) + logs = base / 'regression-logs' + logs.mkdir() # Preserve any earlier run; never overwrite its evidence. + from source_snapshot import original_sources + original=original_sources('coco3-mister') + jobs = [ + ('test_bh_mpi.py', 'mpi-functional', ['--project', str(project)]), + ('test_bh_mpi_core.py', 'mpi-core-functional', [str(project)]), + ('test_ssc_mister_system.py', 'ssc-system-functional', [str(project)]), + ('test_registered_interfaces.py', 'registered-functional', [str(project)]), + ('test_reset_domains.py', 'reset-functional', [str(project)]), + ('test_keyboard_control_phase.py', 'keyboard-functional', [str(project)]), + ('test_peripheral_phase.py', 'peripheral-functional', [str(project)]), + ('test_external_sdram_commands.py', 'commands-functional', [str(project)]), + ('test_external_sdram.py', 'delayed-functional', [str(project)]), + ('test_external_audio.py', 'audio-functional', [str(project)]), + ('test_external_pixel.py', 'pixel-functional', [str(project)]), + ('test_external_i2c.py', 'i2c-functional', [str(project)]), + ('test_coco3_bh_startup.py', 'startup-functional', + [str(project), str(a.main_reference.resolve())]), + ('test_bh_menu.py', 'menu-functional', [str(project), str(a.main_reference.resolve())]), + ('test_video_sdram.py', 'video-functional', [str(original),str(project)]), + ] + + def run(job): + script, name, inputs = job + command = [sys.executable, '-X', 'utf8', '-B', str(ROOT / 'scripts' / script), + *inputs, str(base / name)] + if script not in ('test_coco3_bh_startup.py','test_bh_menu.py'): + command += ['--suite', str(a.suite.resolve())] + if script == 'test_external_sdram.py': + command += ['--check-cpu-data'] + started = time.monotonic() + print('START ' + name, flush=True) + with (logs / (name + '.log')).open('w', encoding='utf-8') as log: + result = subprocess.run(command, cwd=ROOT, stdout=log, + stderr=subprocess.STDOUT) + receipt = dict(name=name, command=command, exit_code=result.returncode, + seconds=round(time.monotonic() - started, 2)) + print(('PASS ' if result.returncode == 0 else 'FAIL ') + name, flush=True) + return receipt + + results = [] + with ThreadPoolExecutor(max_workers=a.jobs) as pool: + for future in as_completed([pool.submit(run, job) for job in jobs]): + results.append(future.result()) + passed = all(item['exit_code'] == 0 for item in results) + (logs / 'result.json').write_text(json.dumps(dict( + passed=passed, scope='Offline functional regressions; no timing/hardware signoff', + results=sorted(results, key=lambda x: x['name'])), indent=2) + '\n') + if not passed: + raise SystemExit('One or more regressions failed; inspect regression-logs') + + +if __name__ == '__main__': + main() diff --git a/scripts/source_snapshot.py b/scripts/source_snapshot.py new file mode 100644 index 0000000..32e831b --- /dev/null +++ b/scripts/source_snapshot.py @@ -0,0 +1,17 @@ +"""Restore original comparison sources from the preserved upstream commit.""" +import hashlib,json,subprocess +from pathlib import Path +ROOT=Path(__file__).resolve().parents[1] +SNAPSHOT='8b8cf72d1fb4de1d05345de8d5b92ec2d500fcd2' +def original_sources(name): + if name!='coco3-mister':raise ValueError('This repository supports MiSTer only') + out=ROOT/'build/source-snapshots'/name + entries=subprocess.check_output(['git','ls-tree','-r','-z',SNAPSHOT],cwd=ROOT).split(b'\0') + for entry in filter(None,entries): + header,name=entry.split(b'\t',1);mode,kind,oid=header.decode().split();name=name.decode() + if kind!='blob' or mode not in ('100644','100755'):raise RuntimeError('Unsupported upstream entry') + data=subprocess.check_output(['git','show',SNAPSHOT+':'+name],cwd=ROOT) + path=out/name + if path.exists() and path.read_bytes()!=data:raise RuntimeError('Preserve changed reference cache: '+name) + if not path.exists():path.parent.mkdir(parents=True,exist_ok=True);path.write_bytes(data) + return out diff --git a/scripts/ssc_integrated_timing.tcl b/scripts/ssc_integrated_timing.tcl new file mode 100644 index 0000000..638f2ba --- /dev/null +++ b/scripts/ssc_integrated_timing.tcl @@ -0,0 +1,49 @@ +# quartus_sta -t ssc_integrated_timing.tcl PROJECT REVISION OUTPUT +package require ::quartus::project +package require ::quartus::sta +set project [file normalize [lindex $quartus(args) 0]] +set revision [lindex $quartus(args) 1] +set output [file normalize [lindex $quartus(args) 2]] +file mkdir $output +cd [file dirname $project] +project_open [file tail $project] -revision $revision +foreach model {slow fast} { + create_timing_netlist -model $model + read_sdc + update_timing_netlist + foreach {name pattern minimum} { + cartridge {*coco3|ssc|*} 1200 + bridge {*coco3|ssc_bridge|*} 30 + controller {*coco3|ssc|controller|*} 400 + speech {*coco3|ssc|speech|*} 400 + audio {*coco3|ssc|audio|*} 100 + ay {*coco3|ssc|ay|*} 100 + glue {*coco3|ssc|glue|*} 15 + host {*coco3|ssc|host|*} 10 + power {*ssc_power_release*} 2 + } { + set nodes [get_keepers $pattern] + set count [get_collection_size $nodes] + puts "SSC_INTEGRATED_SCOPE $model $name $count" + if {$count<$minimum} {error "Incomplete SSC scope: $name"} + set audit [open [file join $output keepers-${name}-${model}.txt] w] + foreach_in_collection node $nodes {puts $audit [get_node_info -name $node]} + close $audit + foreach check {setup hold recovery removal} { + # Setup/hold must have substantive paths. Recovery/removal may legitimately + # be empty for synchronous-only chip helpers; preserve both reports. + report_timing -$check -to $nodes -npaths 40 -detail full_path \ + -file [file join $output ${name}-in-${model}-${check}.rpt] + report_timing -$check -from $nodes -npaths 40 -detail full_path \ + -file [file join $output ${name}-out-${model}-${check}.rpt] + } + } + report_clock_transfers -setup -file [file join $output clock-transfers-${model}.rpt] + if {$model eq "slow"} { + report_clocks -file [file join $output clocks.rpt] + report_ucp -file [file join $output unconstrained.rpt] + report_exceptions -file [file join $output exceptions.rpt] + } + delete_timing_netlist +} +project_close -dont_export_assignments diff --git a/scripts/test_bh_menu.py b/scripts/test_bh_menu.py new file mode 100644 index 0000000..03954b9 --- /dev/null +++ b/scripts/test_bh_menu.py @@ -0,0 +1,161 @@ +#!/usr/bin/env python3 +"""Compile pinned Main's real menu prefix/status parsers against Coco 3 Plus rows. + +Filesystem/OSD rendering and hardware transport are outside this host test. +""" +import argparse +import json +import os +from pathlib import Path +import re +import subprocess + +from test_coco3_bh_startup import block +from validation_common import ROOT, cpp_environment, digest + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('project', type=Path) + p.add_argument('reference', type=Path) + p.add_argument('output', type=Path) + a = p.parse_args() + out = a.output.resolve() + if out.exists() or not out.is_relative_to(ROOT / 'build'): + p.error('Use a fresh build/ output') + out.mkdir(parents=True) + top = a.project / 'CoCo3.sv' + user = a.reference / 'user_io.cpp' + menu = a.reference / 'menu.cpp' + provenance = json.loads((a.reference / 'provenance.json').read_text()) + for source in (user, menu): + assert digest(source) == provenance['files'][source.name]['sha256'] + conf = top.read_text().split('localparam CONF_STR = {', 1)[1].split('};', 1)[0] + entries = re.findall(r'"([^"\n]*)"', conf) + rows = [x[:-1] for x in entries if x.endswith(';')][1:] + user_text = user.read_text() + menu_text = menu.read_text() + # Action-side parser has no drawing calls; keep it byte-for-byte as source. + action = menu_text[menu_text.index('//Hide or Disable flag\n'):] + prefix = block(action, "while ((p[0] == 'H'") + page = block(action, "if (p[0] == 'P')") + definitions = '\n'.join(block(user_text, signature) for signature in ( + 'int user_io_status_bits(', 'uint32_t user_io_status_get(', + 'uint32_t user_io_status_mask(', 'uint32_t user_io_hd_mask(', + 'void user_io_status_set(')) + harness = r''' +#include +#include +#include +#include +#include +static unsigned char cur_status[16]={}; +int user_io_status_bits(const char*,int*,int*,int,int single=0); +bool is_st(){return true;} bool is_minimig(){return false;} +uint32_t minimig_core_extcfg(){return 0;} +void spi_uio_cmd_cont(int){} void spi_w(uint16_t){} void DisableIO(){} +const int UIO_SET_STATUS2=0; +struct Mgl {bool done=true;}; static Mgl instance; static Mgl *mgl=&instance; +'''+definitions+r''' +struct Decoded{bool hidden,disabled,inpage;std::string row;}; +Decoded decode(const char *row,int page,uint32_t hdmask){ + char buffer[1024];strcpy(buffer,row);char *p=buffer; + int h=0,d=0,inpage=!page,flat=0; +'''+prefix+'\n'+page+r''' + return {bool(h),bool(d),bool(inpage),p}; +} +static const char *rows[]={ +'''+',\n'.join(json.dumps(row) for row in rows)+r'''}; +bool visible(const char *label,int page,uint32_t mask,bool *disabled=nullptr){ + for(const char *r:rows){auto d=decode(r,page,mask); + auto comma=d.row.find(',');if(comma==std::string::npos)continue; + if(d.row[0]=='F'||d.row[0]=='S') + comma=d.row.find(',',comma+1); + if(comma==std::string::npos)continue; + std::string tail=d.row.substr(comma+1); + if(tail==label || tail.rfind(std::string(label)+",",0)==0){ + if(disabled)*disabled=d.disabled; + return d.inpage&&!d.hidden; + } + }fprintf(stderr,"Missing contract row: %s page=%d mask=%u\n",label,page,mask); + assert(!"Missing contract row");return false; +} +int main(){ + unsigned options=0; + // Every exposed option uses the actual Main bit parser and setter. Verify + // all its representable values without changing any unrelated status bit. + for(const char *r:rows){auto d=decode(r,1,0);const char *p=d.row.c_str(); + if(*p!='O'&&*p!='o')continue; + int start,end;int ex=*p=='o';int size=user_io_status_bits(p+1,&start,&end,ex,0); + assert(size>0 && end<63); // bit63 is exclusively the RTL migration marker. + char label[128];const char *first=strchr(p,',');assert(first); + const char *last=strchr(first+1,',');assert(last); + size_t length=last-first-1;assert(length=0&&slot<4); + assert(start==43+3*slot && end==45+3*slot); + } + if(!strcmp(label,"Startup slot"))assert(start==12&&end==13); + if(!strcmp(label,"Expansion"))assert(start==42&&end==42); + for(unsigned value=0;value<(1u<end) + assert(((cur_status[bit/8]^before[bit/8])&(1u<<(bit%8)))==0); + }++options; + } + const char *pages[]={"Cartridges & Multi-Pak","Floppy Disks","CoCo SDC", + "Sound & Expansion","Cassette","Machine","Display","Input","Advanced"}; + for(unsigned mask=0;mask<65536;++mask){ + for(const char *p:pages)assert(visible(p,0,mask)); + } + bool disabled=false; + assert(visible("Drive 0",2,0,&disabled)&&!disabled); + assert(visible("Drive 0",2,8,&disabled)&&disabled); + assert(visible("SDC Drive 0",3,2,&disabled)&&disabled); + assert(visible("Expansion",4,1u<<13,&disabled)&&disabled); + assert(!visible("Assign SSC in Multi-Pak",4,0)); + assert(visible("Assign SSC in Multi-Pak",4,1u<<13)); + assert(visible("Slot 1 ROM",1,0)&&!visible("Slot 1 ROM",1,1u<<8)); + assert(visible("Slot 4 ROM",1,0)&&!visible("Slot 4 ROM",1,1u<<11)); + assert(!visible("Legacy cartridge",0,1)); + assert(!visible("Load SSC controller (4K)",0,16)); + assert(!visible("Load SSC voice (2K)",0,16)); + assert(visible("Sound & Speech ready",4,0)); + assert(!visible("Sound & Speech ready",4,1u<<6)); + assert(visible("Sound & Speech error",4,0)); + assert(!visible("Sound & Speech error",4,1u<<7)); + assert(visible("Orchestra90 stereo enabled",4,0)); + assert(!visible("Orchestra90 stereo enabled",4,1u<<15)); + for(const char *r:rows){auto d=decode(r,1,0); + if(d.row.rfind("-,",0)==0)assert(d.row.size()-2<=27); + } + // Ordinary page membership survives H/D prefixes; unrelated pages stay out. + assert(!visible("Drive 0",1,0));assert(!visible("Slot 1 ROM",2,0)); + printf("PASS native Main menu: 9 stable pages across65536 masks, %u options with isolated status writes, device visibility and disabled controls\n",options); +} +''' + cpp = out / 'menu-contract.cpp' + cpp.write_text(harness) + compiler, env = cpp_environment(out) + exe = out / ('menu-contract.exe' if os.name == 'nt' else 'menu-contract') + command = ([compiler, '/nologo', '/std:c++17', '/EHsc', '/O2', + '/D_CRT_SECURE_NO_WARNINGS', '/Fe:' + str(exe), str(cpp)] + if os.name == 'nt' else [compiler, '-std=c++17', '-O2', str(cpp), '-o', str(exe)]) + with (out / 'compile.log').open('w') as log: + subprocess.run(command, cwd=out, env=env, stdout=log, + stderr=subprocess.STDOUT, check=True) + result = subprocess.run([str(exe)], capture_output=True, text=True) + (out / 'run.log').write_text(result.stdout + result.stderr) + result.check_returncode() + paths = (top, user, menu, cpp, Path(__file__)) + (out / 'result.json').write_text(json.dumps(dict(passed=True, + scope='Pinned native Main parsing; no OSD drawing or FPGA/hardware test', + result=result.stdout.strip(), sha256={str(x.resolve()): digest(x) for x in paths}), indent=2)+'\n') + print(result.stdout, end='') + + +if __name__ == '__main__': + main() diff --git a/scripts/test_bh_mpi.py b/scripts/test_bh_mpi.py new file mode 100644 index 0000000..ee27f17 --- /dev/null +++ b/scripts/test_bh_mpi.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 +"""Exercise actual four-slot modules and independently detect routing/storage defects.""" +import argparse +import hashlib +import json +import os +from pathlib import Path +import subprocess + +ROOT=Path(__file__).resolve().parents[1] + +def main(): + p=argparse.ArgumentParser(description=__doc__) + p.add_argument('output',type=Path) + p.add_argument('--suite',type=Path,required=True) + p.add_argument('--project',type=Path,default=ROOT) + a=p.parse_args();out=a.output.resolve() + if out.exists() or not out.is_relative_to(ROOT/'build'):p.error('Use a fresh build/ directory') + out.mkdir(parents=True) + sources=[a.project/'rtl'/('bh_mpi_'+n+'.sv') for n in ('config','router','rom')] + bench=ROOT/'tests/bh_mpi_tb.sv' + 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 '' + variants=[('native',None),('rom-route',('router','layout[cts*3+:3]','layout[scs*3+:3]')), + ('rom-slot-alias',('rom','index==6?0:index==7?1:index==9?3:2','2\'d0')), + ('singleton',('config','remaining=mask&~used','remaining=mask'))] + results=[] + for name,change in variants: + folder=out/name;folder.mkdir();files=[] + for source in sources: + text=source.read_text() + if change and source.stem=='bh_mpi_'+change[0]: + assert text.count(change[1])==1,change + text=text.replace(change[1],change[2]) + dest=folder/source.name;dest.write_text(text,encoding='utf-8',newline='\n');files.append(dest) + binary=folder/'test.vvp' + run=subprocess.run([str(a.suite/'bin'/('iverilog'+ext)),'-g2012','-s','bh_mpi_tb','-o',str(binary),str(bench),*map(str,files)],env=env,capture_output=True,text=True) + (folder/'compile.log').write_text(run.stdout+run.stderr) + if run.returncode:raise RuntimeError('Compile failed: '+str(folder)) + run=subprocess.run([str(a.suite/'bin'/('vvp'+ext)),str(binary)],env=env,capture_output=True,text=True,timeout=180) + log=run.stdout+run.stderr;(folder/'rtl.log').write_text(log) + if name=='native':assert run.returncode==0 and 'PASS 65536 routing combinations' in log,log + else:assert run.returncode!=0 and 'FATAL' in log,(name,log) + results.append(dict(name=name,exit_code=run.returncode,result=log.strip())) + print(name+': '+log.strip(),flush=True) + obj=dict(passed=True,source_sha256={str(x):hashlib.sha256(x.read_bytes()).hexdigest() for x in [*sources,bench,Path(__file__)]},cases=results,hardware_tested=False) + (out/'result.json').write_text(json.dumps(obj,indent=2)+'\n') + +if __name__=='__main__':main() diff --git a/scripts/test_bh_mpi_core.py b/scripts/test_bh_mpi_core.py new file mode 100644 index 0000000..2e68000 --- /dev/null +++ b/scripts/test_bh_mpi_core.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 +"""Check actual core ROM/address/bank/IRQ/restart bindings with real slot RAM. + +The CPU bus and system/disk ROM bytes are stimuli. This is not a full-core +vendor-IP simulation; exact source snippets are compiled without rewriting them. +""" +import argparse +import hashlib +import json +import os +from pathlib import Path +import re +import subprocess + +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);a=p.parse_args() + out=a.output.resolve() + if out.exists() or not out.is_relative_to(ROOT/'build'):p.error('Use fresh build/ output') + out.mkdir(parents=True);core=a.project/'rtl/coco3fpga.sv';s=core.read_text() + def region(start,end):return s[s.index(start):s.index(end,s.index(start))] + routing=region('wire [2:0] mpi_rom_kind,mpi_io_kind;','wire [7:0] mpi_orch_right=') + routing+=s[s.index('wire [7:0] mpi_orch_right='):s.index("wire [7:0] mpi_orch_right=")+len("wire [7:0] mpi_orch_right=mpi_orchestra_present?ORCH_RIGHT:8'h80;")] + bank_declarations=region('reg [2:0] rom_banks[0:3];','integer rom_bank_index;')+'integer rom_bank_index;' + bank=region('/*\n$FF40 -','wire [3:0]\tConfig_FLAG') + if 'always @(negedge clk_sys or negedge RESET_N)' not in bank:raise RuntimeError('Bank source contract changed') + romdecode=region('assign FLASH_DATA =','assign\tVDAC_EN =') + addresses=region('assign FLASH_ADDRESS =','// Empty cartridge sockets') + irq=region('// A loaded ROM drives','assign CART_INT_N = CART_INT_IN_N;') + restart=region('reg mpi_rom_cold_pending=0;','AMW coco_AMW (') + trigger=re.search(r'\.Trigger\((AMW_Trigger \|\| \(mpi_rom_cold_pending && AMW_Ready\))\)',s) + assert trigger + selector=re.search(r"16'hFF7F:\s*begin\s*MPI_SCS <= DATA_OUT\[1:0\];\s*MPI_CTS <= DATA_OUT\[5:4\];\s*end",s)[0] + generated='''module actual_mpi_core(input clk_sys,SSC_POWER_RESET,RESET_N,CART_SEL,ROM_SEL,PH_2,RW_N, +input [15:0] ADDRESS,input [1:0] ROM,input [9:0] SWITCH,input [7:0] DATA_OUT, +input [11:0] MPI_LAYOUT,input MPI_BOOT_LOADING,input ioctl_download,ioctl_wr,input [15:0] ioctl_index, +input [24:0] ioctl_addr,input [7:0] ioctl_data,input ext_response,SER_IRQ, +input AMW_Trigger,AMW_Ready,AMW_EN, +output [7:0] FLASH_DATA,output HDD_EN,SDC_OBSERVE,RS232_EN,SLOT3_HW, +output [3:0] MPI_ROM_FAULT,output MPI_ROM_LOADING,MPI_ROM_LOADED,RESTART, +output reg [1:0] MPI_SCS,MPI_CTS,output reg CART_INT_IN_N); +wire [7:0] COCO3_ROM_DATA=8'haa,COCO3_DISK_ROM_DATA=8'hd4,CART_DATA; +wire [7:0] ORCH_LEFT=8'h80,ORCH_RIGHT=8'h80; +wire [21:0] FLASH_ADDRESS; +wire ENA_DISK2,ENA_PAK,ENA_DSK; +wire SSC_MODE=1'b1; +'''+routing+'\n'+bank_declarations+'\n'+addresses+'\n'+romdecode+'\n'+bank+'\n'+irq+'\n'+restart+''' +always @(negedge clk_sys or negedge RESET_N)begin + if(!RESET_N)begin MPI_SCS<=SWITCH[2:1];MPI_CTS<=SWITCH[2:1];end + else if(PH_2&&!RW_N)begin case(ADDRESS) +'''+selector+''' + default:; + endcase end +end +assign RESTART='''+trigger[1]+'''; +assign SDC_OBSERVE=SDC_EN_CS; +endmodule +''' + wrapper=out/'actual-core.sv';wrapper.write_text(generated,encoding='utf-8',newline='\n') + bench=ROOT/'tests/bh_mpi_core_tb.sv' + modules=[a.project/'rtl/bh_mpi_router.sv',a.project/'rtl/bh_mpi_rom.sv',a.project/'rtl/bh_mpi_config.sv'] + 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 '' + cases=[] + for tag,define,mutation in [('ordinary',False,None),('os9-compatibility',True,None), + ('wrong-bank-route',False,('rom_banks[MPI_SCS] <= DATA_OUT[2:0];','rom_banks[MPI_CTS] <= DATA_OUT[2:0];')), + ('lost-restart',False,('assign RESTART='+trigger[1], 'assign RESTART=AMW_Trigger || MPI_ROM_LOADED')), + ('lost-startup-autoload',False,('MPI_BOOT_LOADING||device_kind==1', 'device_kind==1')), + ('startup-main-order',False,None),('early-init-handshake',False,None)]: + startup=tag in ('startup-main-order','early-init-handshake') + active_bench=ROOT/'tests/bh_mpi_startup_tb.sv' if startup else bench + active_modules=modules.copy() + rejected=mutation is not None or tag=='early-init-handshake' + if tag=='early-init-handshake': + original=modules[-1].read_text() + guard='host_started&&!requested[0]&&requested==last_requested&&pending&&!status_set' + assert original.count(guard)==1 + bad=out/'early-init-config.sv' + bad.write_text(original.replace(guard,'pending&&!status_set'),encoding='utf-8',newline='\n') + active_modules[-1]=bad + active_wrapper=wrapper + if mutation: + assert generated.count(mutation[0])==1 + active_wrapper=out/(tag+'-core.sv') + active_wrapper.write_text(generated.replace(*mutation),encoding='utf-8',newline='\n') + binary=out/(tag+'.vvp') + cmd=[str(a.suite/'bin'/('iverilog'+ext)),'-g2012','-s', + 'bh_mpi_startup_tb' if startup else 'bh_mpi_core_tb','-o',str(binary)] + if define:cmd+=['-DCoCo3_sdc_fix_os9_driver'] + run=subprocess.run([*cmd,str(active_wrapper),str(active_bench),*map(str,active_modules)],env=env,capture_output=True,text=True) + (out/(tag+'-compile.log')).write_text(run.stdout+run.stderr) + if run.returncode:raise RuntimeError('Actual core binding compile failed: '+tag) + run=subprocess.run([str(a.suite/'bin'/('vvp'+ext)),str(binary)],env=env,capture_output=True,text=True,timeout=120) + log=run.stdout+run.stderr;(out/(tag+'.log')).write_text(log) + if rejected:assert run.returncode!=0 and 'FATAL' in log,(tag,log) + else:assert run.returncode==0 and 'PASS actual core MPI bindings' in log,log + print(tag+': '+log.strip(),flush=True);cases.append(dict(name=tag,result=log.strip())) + files=[core,wrapper,bench,ROOT/'tests/bh_mpi_startup_tb.sv',*modules,Path(__file__)] + (out/'result.json').write_text(json.dumps(dict(passed=True,hardware_tested=False,cases=cases,source_sha256={str(x):hashlib.sha256(x.read_bytes()).hexdigest() for x in files}),indent=2)+'\n') + +if __name__=='__main__':main() diff --git a/scripts/test_coco3_bh_startup.py b/scripts/test_coco3_bh_startup.py new file mode 100644 index 0000000..cf04164 --- /dev/null +++ b/scripts/test_coco3_bh_startup.py @@ -0,0 +1,179 @@ +#!/usr/bin/env python3 +"""Exercise the pinned original MiSTer FC parser with BH records and mocked I/O. + +This verifies host parser/record/index behavior, not the installed ARM binary, +FPGA configuration, analog timing or physical startup. No Main source is edited. +""" +import argparse +import json +import os +from pathlib import Path +import re +import subprocess + +from validation_common import ROOT, digest, cpp_environment +from coco3_bh_profile import NAME, ROM_SLOTS, startup_records + + +def block(text, anchor): + start = text.index(anchor) + opening = text.index('{', start) + depth = 1 + end = opening + 1 + while depth: + depth += (text[end] == '{') - (text[end] == '}') + end += 1 + return text[start:end] + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('project', type=Path) + p.add_argument('reference', type=Path) + p.add_argument('output', type=Path) + a = p.parse_args() + out = a.output.resolve() + if out.exists() or not out.is_relative_to(ROOT / 'build'): + p.error('Use a fresh build directory') + out.mkdir(parents=True) + source = a.reference / 'user_io.cpp' + provenance = json.loads((a.reference / 'provenance.json').read_text()) + if digest(source) != provenance['files']['user_io.cpp']['sha256']: + raise RuntimeError('Pinned Main parser changed') + original = source.read_text() + # Main's real initialization order matters to slot-ROM eligibility: FC + # parsing precedes saved status restoration while bit0 remains asserted. + init_reset = original.index('user_io_status_set("[0]", 1);', original.index('void user_io_init(')) + parse_call = original.index('parse_config();', init_reset) + saved_config = original.index('int config_found = FileLoadConfig(name, cur_status', parse_call) + release_reset = original.index('user_io_status_set("[0]", 0);', saved_config) + assert init_reset < parse_call < saved_config < release_reset + file_tx = block(original, 'int user_io_file_tx(const char* name,') + acknowledgement = block(original, 'static void check_status_change()') + assert 'check_status_change();' in file_tx + assert 'user_io_status_set("[0]", 0);' in acknowledgement + parser = block(original, "if (p[0] == 'F')") + substring = block(original, 'int substrcpy(') + extension = block(original, 'unsigned char user_io_ext_idx(') + top = a.project / 'CoCo3.sv' + if 'bh_mpi_config mpi_configuration' in top.read_text(): + assert '.MPI_BOOT_LOADING(status[0])' in top.read_text(), 'Retain FC files until saved layout arrives' + conf = top.read_text().split('localparam CONF_STR = {', 1)[1].split('};', 1)[0] + lines = re.findall(r'"([^"\n]*)"', conf) + if not lines[0].startswith('Coco 3 Plus;'): + raise RuntimeError('Fitted source does not have the independent identity') + picks = [next(x[:-1] for x in lines if x.startswith(f'H4FC{n},')) for n in ROM_SLOTS] + cases = [ + ('default', NAME, picks, [4, 5]), + ('hidden-independent', NAME, ['H4D0' + x[2:] for x in picks], [4, 5]), + ('legacy-manual', NAME, [x.replace('FC', 'F', 1) for x in picks], []), + ('stock-isolated', 'COCO3', picks, []), + ('missing-voice', NAME, picks, [4]), + ('rom-extension', NAME, picks, [68, 69]), + ] + slot_picks = [next(x[:-1] for x in lines if re.match(r'H[89AB]P1FC'+str(n)+',', x)) + for n in range(6, 10)] if any('P1FC6,' in x for x in lines) else [] + if slot_picks: + cases.append(('slot-autoload', NAME, slot_picks, [6, 7, 8, 9])) + records = startup_records() + if slot_picks: + for n in range(6, 10): + value = f'/media/fat/games/coco3plus/slot{n-5}.ccc'.encode() + records[f'config/{NAME}.f{n}'] = value.ljust(1024, b'\0') + for path, data in records.items(): + target = out / path + target.parent.mkdir(exist_ok=True) + target.write_bytes(data) + harness = r''' +#include +#include +#include +#include +#include +#include +#ifdef _MSC_VER +#define strcasecmp _stricmp +#else +#include +#endif +#include +#include +static const char *identity, *scenario; +static int boot0_loaded=0; +static std::vector sent; +const char *user_io_get_core_name(){return identity;} +bool is_cpc(){return false;} +void StoreIdx_F(int,const char*){} +int FileLoadConfig(const char *name,void *buffer,int size){ + std::string path="config/";path+=name; + if(!strcmp(scenario,"missing-voice") && path.find(".f5")!=std::string::npos)return 0; + FILE *f=fopen(path.c_str(),"rb");if(!f)return 0; + int n=fread(buffer,1,size,f);fclose(f); + if(!strcmp(scenario,"rom-extension")) { + char *s=(char*)buffer;char *e=strrchr(s,'.');assert(e);strcpy(e,".rom"); + } + assert(((char*)buffer)[size-1]==0);return n; +} +void user_io_file_tx(const char *name,int index,int,int,int,uint32_t address){ + assert(!strncmp(name,"/media/fat/games/coco3plus/",strlen("/media/fat/games/coco3plus/"))); + assert(address==0);sent.push_back(index); + printf("TX %d %s\n",index,name); +} +''' + generated = harness + '\n' + substring + '\n' + extension + '\nvoid load(char *p){\nchar str[1024]={},ext[256]={};\n' + generated += 'while((p[0]==\'H\'||p[0]==\'D\'||p[0]==\'h\'||p[0]==\'d\')&&strlen(p)>=2)p+=2;\n' + # Exact page-prefix skip from pinned user_io.cpp's config initialization. + page_skip = re.search(r"if \(p\[0\] == 'P'\) p \+= 2;", original) + if not page_skip: + raise RuntimeError('Pinned Main page-prefix contract changed') + generated += page_skip[0] + '\n' + # Exercise the exact original Main name reader with the display identity and + # native MGL override, including embedded spaces and its real 32-byte fields. + name_reader = block(original, 'void user_io_read_core_name()') + name_fixture = r'''namespace identity_contract { +static char core_name[32]={},orig_name[32]={},ovr_name[32]={}; +static int is_no_type=0; +char *user_io_get_confstr(int){static char n[]="Coco 3 Plus";return n;} +'''+name_reader+r''' +void run(){ + user_io_read_core_name(); + assert(!strcmp(core_name,"Coco 3 Plus") && !strcmp(orig_name,"Coco 3 Plus")); + strcpy(ovr_name,"coco3plus");user_io_read_core_name(); + assert(!strcmp(core_name,"coco3plus") && !strcmp(orig_name,"Coco 3 Plus")); +} +} +''' + generated += parser + '\n}\n'+name_fixture+'\nint main(int argc,char **argv){assert(argc==3);identity_contract::run();identity=argv[1];scenario=argv[2];\n' + for tag, identity, options, expected in cases: + generated += f'if(!strcmp(scenario,{json.dumps(tag)})){{\n' + for item in options: + generated += f'{{char p[]={json.dumps(item)};load(p);}}\n' + generated += 'assert(boot0_loaded==0);assert((sent==std::vector{' + ','.join(map(str, expected)) + '}));}\n' + generated += 'puts("PASS native Main FC startup parser");}\n' + cpp = out / 'main-fc-probe.cpp' + cpp.write_text(generated) + compiler, env = cpp_environment(out) + ext = '.exe' if os.name == 'nt' else '' + exe = out / ('probe' + ext) + with (out / 'compile.log').open('w') as log: + command = ([compiler, '/nologo', '/std:c++17', '/EHsc', '/O2', '/D_CRT_SECURE_NO_WARNINGS', '/Fe:' + str(exe)] + if os.name == 'nt' else [compiler, '-std=c++17', '-O2', '-o', str(exe)]) + subprocess.run([*command, str(cpp)], cwd=out, + env=env, stdout=log, stderr=subprocess.STDOUT, check=True) + results = [] + for tag, identity, _, expected in cases: + result = subprocess.run([str(exe), identity, tag], cwd=out, env=env, capture_output=True, text=True) + (out / (tag + '.log')).write_text(result.stdout + result.stderr) + if result.returncode or 'PASS native Main FC startup parser' not in result.stdout: + raise RuntimeError('Startup parser probe failed: ' + tag) + results.append({'case': tag, 'indices': expected, 'log_sha256': digest(out / (tag + '.log'))}) + data = {'passed': True, 'hardware_tested': False, 'main_reference': provenance, + 'top_sha256': digest(top), 'records': {k: {'bytes': len(v), 'path': v.split(b'\0')[0].decode()} for k, v in records.items()}, + 'cases': results, 'script_sha256': digest(Path(__file__)), + 'scope': 'Original native Main FC/extension parser; mocked file I/O and transport; installed binary startup remains a hardware check'} + (out / 'result.json').write_text(json.dumps(data, indent=2) + '\n') + print(f'PASS {len(cases)} original-Main startup cases, including applicable page-scoped slot ROM records') + + +if __name__ == '__main__': + main() diff --git a/scripts/test_external_audio.py b/scripts/test_external_audio.py new file mode 100644 index 0000000..1943c89 --- /dev/null +++ b/scripts/test_external_audio.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +"""Check the real platform serializer's timing slots; reject a same-edge defect.""" +import argparse +import hashlib +import json +import os +from pathlib import Path +import subprocess + +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) + a = p.parse_args() + out = a.output.resolve() + if not out.is_relative_to(ROOT / 'build') or out.exists(): + p.error('Use a fresh build/ directory') + out.mkdir(parents=True) + source = a.project / 'sys/audio_out.v' + i2s = a.project / 'sys/i2s.v' + text = source.read_text() + ce = text[text.index('localparam AUDIO_RATE'):text.index('\ni2s i2s')] + ce = ce.replace('always @(posedge clk) begin', 'always @(posedge clk) begin : ce_phase', 1) + at = ce.index('reg i2s_ce;') + ce = ce[:at] + ce[at:].replace('always @(posedge clk) begin', 'always @(posedge clk) begin : divider_phase', 1) + wrapper = ('module audio_pin_contract(input clk,reset,sample_rate,output bclk,lrclk,data);\n' + 'localparam CLK_RATE=24576000;\n' + ce + '\n' + 'i2s i2s(.reset(reset),.clk(clk),.ce(i2s_ce),.sclk(bclk),.lrclk(lrclk),.sdata(data),' + '.left_chan(16\'ha55a),.right_chan(16\'h5aa5));\nendmodule\n') + (out / 'wrapper.sv').write_text(wrapper) + (out / 'i2s.v').write_bytes(i2s.read_bytes()) + 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_audio_tb', '-o', str(out / 'run.vvp'), + str(ROOT / 'tests/external_audio_tb.sv'), str(out / 'wrapper.sv'), str(out / 'i2s.v')] + for negative in (False, True): + tag = 'negative' if negative else 'positive' + if negative: + # Deliberately invert the forwarded sampling edge. + mutant = i2s.read_text().replace('sclk <= msclk;', 'sclk <= ~msclk;') + assert mutant != i2s.read_text() + (out / 'i2s.v').write_text(mutant) + with (out / f'{tag}-compile.log').open('w') as log: + subprocess.run(cmd, env=env, stdout=log, stderr=subprocess.STDOUT, check=True) + with (out / f'{tag}.log').open('w') as log: + result = subprocess.run([str(a.suite / 'bin' / ('vvp' + ext)), str(out / 'run.vvp')], + env=env, stdout=log, stderr=subprocess.STDOUT, timeout=60) + log_text = (out / f'{tag}.log').read_text() + print(log_text, end='') + if (not negative and (result.returncode or 'PASS audio pin slots' not in log_text)) or ( + negative and (not result.returncode or 'I2S receiver setup slot lost' not in log_text)): + raise RuntimeError(f'Unexpected {tag} result') + (out / 'i2s.v').write_bytes(i2s.read_bytes()) + (out / 'result.json').write_text(json.dumps({'passed': True, 'wrong_edge_mutant_rejected': True, + 'setup_min_fabric_cycles': 5, 'hold_min_fabric_cycles': 3, 'modes_hz': [48000, 96000], + 'scope': 'real CE and I2S RTL; no analog edge/pull-up or external receiver model', + 'source_sha256': {str(path.relative_to(a.project)): hashlib.sha256(path.read_bytes()).hexdigest() + for path in (source, i2s)}}, indent=2) + '\n') + + +if __name__ == '__main__': + main() diff --git a/scripts/test_external_i2c.py b/scripts/test_external_i2c.py new file mode 100644 index 0000000..e7b9271 --- /dev/null +++ b/scripts/test_external_i2c.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python3 +"""Check actual MCP I2C master against fast-mode slots and finite release delay.""" +import argparse +import hashlib +import json +import os +from pathlib import Path +import re +import subprocess + +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) + 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 / 'sys/i2c.v' + wrapper = a.project / 'sys/mcp23009.sv' + m = re.search(r'i2c\s*#\(50_000_000,\s*([\d_]+)\)', wrapper.read_text()) + assert m + native_hz = int(m[1].replace('_', '')) + 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 '' + results = [] + for hz in sorted({native_hz, 250000, 500000}): + # Four independent pin-edge extrema for the accepted profile; + # the ideal legacy waveform is the negative frequency/low-time control. + corners = range(16) if hz == 250000 else (0, 1) + for corner in corners: + scl_fall = 300 if corner & 1 else 0 + scl_release = 300 if corner & 2 else 0 + sda_fall = 300 if corner & 4 else 0 + sda_release = 300 if corner & 8 else 0 + tag = f'{hz}-{corner}' + text = source.read_text() + # Icarus requires declarations before their use in delayed drivers; + # Quartus accepts the original declaration order. No logic changes. + declarations = [] + for name in ('SCLK', 'SDO'): + d = re.search(r'^reg\s+(?:\[[^\]]+\]\s*)?' + name + r';', text, re.M) + assert d + declarations.append(d[0]) + text = text.replace(d[0], '', 1) + text = text.replace('assign I2C_SCL =', '\n'.join(declarations) + '\nassign I2C_SCL =', 1) + text = text.replace('assign I2C_SCL =', f'assign #(0,{scl_fall},{scl_release}) I2C_SCL =') + text = text.replace('assign I2C_SDA =', f'assign #(0,{sda_fall},{sda_release}) I2C_SDA =') + (out / 'i2c.v').write_text(text) + cmd = [str(a.suite / 'bin' / ('iverilog' + ext)), '-g2012', f'-DBUS_HZ={hz}', + f'-DSDA_FALL_NS={sda_fall}', f'-DSDA_RELEASE_NS={sda_release}', '-s', 'external_i2c_tb', + '-o', str(out / 'run.vvp'), str(ROOT / 'tests/external_i2c_tb.sv'), str(out / 'i2c.v')] + with (out / f'{tag}-compile.log').open('w') as log: + subprocess.run(cmd, env=env, stdout=log, stderr=subprocess.STDOUT, check=True) + with (out / f'{tag}.log').open('w') as log: + r = subprocess.run([str(a.suite / 'bin' / ('vvp' + ext)), str(out / 'run.vvp')], env=env, + stdout=log, stderr=subprocess.STDOUT, timeout=60) + text = (out / f'{tag}.log').read_text() + print(text, end='') + if hz == 500000: + assert r.returncode and ('I2C low below 1300ns' in text or 'I2C fast-mode period below 2500ns' in text) + else: + assert not r.returncode and 'PASS I2C fast-mode slots' in text + results.append({'bus_hz': hz, 'scl_fall_ns': scl_fall, 'scl_release_ns': scl_release, + 'sda_fall_ns': sda_fall, 'sda_release_ns': sda_release, 'exit_code': r.returncode, + 'log_sha256': hashlib.sha256((out / f'{tag}.log').read_bytes()).hexdigest()}) + (out / 'result.json').write_text(json.dumps({'native_bus_hz': native_hz, 'fast_profile_passed': native_hz == 250000, + 'scope': 'actual master, NACK/released FF and maximum-900ns ACK/slave-data cases; independent 0/300ns pin-edge extrema, no physical slave/RC measurement', + 'source_sha256': {str(f.relative_to(a.project)): hashlib.sha256(f.read_bytes()).hexdigest() for f in (source, wrapper)}, + 'results': results}, indent=2) + '\n') + + +if __name__ == '__main__': + main() diff --git a/scripts/test_external_pixel.py b/scripts/test_external_pixel.py new file mode 100644 index 0000000..d513d44 --- /dev/null +++ b/scripts/test_external_pixel.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +"""Verify the actual pixel divider's generated-clock edges and reject a defect.""" +import argparse +import hashlib +import json +import os +from pathlib import Path +import re +import subprocess + +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) + a = p.parse_args() + out = a.output.resolve() + if not out.is_relative_to(ROOT / 'build') or out.exists(): + p.error('Use a fresh build/ directory') + out.mkdir(parents=True) + source = a.project / 'rtl/Mister_Video.v' + sdc = a.project / 'external-io.sdc' + text = source.read_text() + divider = re.search(r'always @ \(posedge MASTER_CLK\)\s*begin\s*reg\s*\[1:0\]\s*div;.*?\nend', text, re.S) + assert divider is not None + assert '-edges {3 7 11}' in sdc.read_text() + block = divider[0].replace('begin', 'begin : divider', 1) + 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 '' + bench = '''`timescale 1ns/1ps +module tb; +reg clk=0; always #5 clk=~clk; +wire pix; generator dut(clk,pix); +integer cycles=0, rises=0, last_rise=0, last_fall=0; +reg previous=0; +always @(posedge clk) cycles=cycles+1; +// Observe the registered final value after all nonblocking assignments settle. +// The original RTL assigns default low then conditionally high in one process. +always @(negedge clk) begin +if(pix && !previous) begin + if(rises==0 && cycles!=2) $fatal(1,"Pixel first edge %0d",cycles); + if(rises>0 && cycles-last_rise!=4) $fatal(1,"Pixel period %0d",cycles-last_rise); + if(rises>0 && cycles-last_fall!=2) $fatal(1,"Pixel low width"); + last_rise=cycles;rises=rises+1; +end +if(!pix && previous && rises>0) begin + if(cycles-last_rise!=2) $fatal(1,"Pixel high width"); + last_fall=cycles; +end +previous=pix; +end +initial begin + dut.divider.div=0; + repeat(4096) @(negedge clk); + if(rises!=1024) $fatal(1,"Pixel count"); + $display("PASS pixel edges {3 7 11}: 1024 periods, divide four, duty half"); + $finish; +end +endmodule +''' + (out / 'tb.sv').write_text(bench) + cmd = [str(a.suite / 'bin' / ('iverilog' + ext)), '-g2012', '-s', 'tb', '-o', str(out / 'run.vvp'), str(out / 'tb.sv'), str(out / 'generator.sv')] + for negative in (False, True): + tag = 'negative' if negative else 'positive' + logic = block.replace("(div == 2'd2)", "(div == 2'd3)") if negative else block + (out / 'generator.sv').write_text('module generator(input MASTER_CLK,output reg PIX_CLK);\n' + logic + '\nendmodule\n') + with (out / f'{tag}-compile.log').open('w') as log: + subprocess.run(cmd, env=env, stdout=log, stderr=subprocess.STDOUT, check=True) + with (out / f'{tag}.log').open('w') as log: + r = subprocess.run([str(a.suite / 'bin' / ('vvp' + ext)), str(out / 'run.vvp')], env=env, stdout=log, stderr=subprocess.STDOUT, timeout=30) + output = (out / f'{tag}.log').read_text() + print(output, end='') + if (not negative and (r.returncode or 'PASS pixel edges' not in output)) or (negative and (not r.returncode or 'Pixel' not in output)): + raise RuntimeError('Unexpected divider result: ' + tag) + (out / 'result.json').write_text(json.dumps({'passed': True, 'wrong_duty_mutant_rejected': True, + 'generated_edges': [3, 7, 11], 'periods': 1024, + 'scope': 'extracted actual divider; FPGA zero power-up counter assumption; not pixel rendering', + 'source_sha256': {str(path.relative_to(a.project)): hashlib.sha256(path.read_bytes()).hexdigest() for path in (source, sdc)}}, indent=2) + '\n') + + +if __name__ == '__main__': + main() diff --git a/scripts/test_external_sdram.py b/scripts/test_external_sdram.py new file mode 100644 index 0000000..b4ee4da --- /dev/null +++ b/scripts/test_external_sdram.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python3 +"""Delayed SDRAM read-window experiment using the existing independent line oracle. + +This is a digital corner model, not vendor silicon or signal-integrity simulation. +It models the fitted clock skew and return propagation explicitly; source stays +unchanged. Generated variants test whether ready strobes select the right beat. +""" +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('--check-cpu-data', action='store_true', + help='Also check the competing CPU read payload at the actual positive-edge consumer') + p.add_argument('--legacy-extra-launch-cycle', action='store_true', + help='Reproduce the rejected model that added tAC after three whole CL3 cycles') + args = p.parse_args() + out = args.output.resolve() + if not out.is_relative_to(ROOT / 'build') or out.exists(): + p.error('Use a fresh build/ directory') + out.mkdir(parents=True) + 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 '' + source = args.project / 'rtl/sdram/sdram2.sv' + fetch = (args.project / 'rtl/coco_mem_fetch.sv').read_text() + import re + for name in ('SDRAM_VID_REQ', 'BUFF_ADD', 'BUFF_DATA_O', 'BUFFER_WRITE'): + fetch, n = re.subn(r'(output\s+)(?!reg)(\[[^\]]+\]\s*)?(' + name + r'\b)', r'\1reg \2\3', fetch, count=1) + assert n == 1 + fetch = re.sub(r'wire(\s+\[2:0\]\s+BUF_HBORDER;)', r'reg\1', fetch, count=1) + (out / 'fetch.sv').write_text(fetch) + bench_source = (ROOT / 'tests/video_sdram_tb.sv').read_text() + if args.check_cpu_data: + # The existing video oracle already checks independent addresses. Its + # competing CPU channel used to count READY without checking payload. + cpu_address = int(re.search(r"sdram_cpu_addr\(25'h([0-9a-fA-F]+)\)", bench_source)[1], 16) + word = cpu_address >> 1 + expected = (word & 0xffff) ^ (((word >> 16) & 255) * 0x101) ^ 0x96a5 + old = 'if(cpu_ready) cpu_reads<=cpu_reads+1;' + assert bench_source.count(old) == 1 + bench_source = bench_source.replace(old, + f'if(cpu_ready) begin cpu_reads<=cpu_reads+1; ' + f'if(dout!==16\'h{expected:04x}) $fatal(1,"CPU read data mismatch value=%h",dout); end') + records = [] + native_extra_match = re.search(r'localparam READ_CAPTURE_EXTRA\s*=\s*(\d+)', source.read_text()) + native_extra = int(native_extra_match[1]) if native_extra_match else 0 + # Clock skew bounds are diagnostic envelopes; latest tAC and earliest tOH + # use different stable-data corners. 0/0 is the old logical model control. + for corner, clock_skew, return_delay, command_delay in [('logical', 0, 0, 0), ('late', 4.5, 8.245, 5.0), ('early', 1.5, 3.121, 1.0)]: + for extra_ready in (0, 1): + folder = out / f'{corner}-ready{extra_ready}' + folder.mkdir() + for name in ('reference', 'candidate'): + text = normalize_controller(source.read_text(), 'sdram_' + name) + if native_extra_match: + text = re.sub(r'localparam READ_CAPTURE_EXTRA\s*=\s*\d+', 'localparam READ_CAPTURE_EXTRA = ' + str(extra_ready), text) + elif extra_ready: + # Expand the whole ready pipeline by one, preserving ordering. + text = text.replace('[CAS_LATENCY+BURST_LENGTH:0]', '[CAS_LATENCY+BURST_LENGTH+1:0]') + text = text.replace('[CAS_LATENCY+BURST_LENGTH]', '[CAS_LATENCY+BURST_LENGTH+1]') + (folder / (name + '.sv')).write_text(text) + bench = bench_source.replace('always #5 clk=~clk;', 'always #4.365079 clk=~clk;') + physical_launch_cycles = 3 if corner == 'logical' or args.legacy_extra_launch_cycle else 2 + if physical_launch_cycles == 2: + # Alliance Fig31.2: READ at T4, Ax0 launches after T6 and + # is sampled at T7. CL3's third edge is the receive boundary; + # adding tAC after T7 incorrectly adds another whole cycle. + old = "pipe[2]=contents(word_address);pipe[3]=contents(word_address ^ 24'd1);\n valid[2]=1;valid[3]=1;" + new = "pipe[1]=contents(word_address);pipe[2]=contents(word_address ^ 24'd1);\n valid[1]=1;valid[2]=1;" + assert bench.count(old) == 1 + bench = bench.replace(old, new) + bench = bench.replace('COMMAND_DELAY_NS=0', 'COMMAND_DELAY_NS=' + str(command_delay)) + bench = bench.replace('always @(negedge clk) begin\n drive <= #(RETURN_DELAY_NS) (valid[0]?pipe[0]:16\'hzzzz);', + # Transport each edge: an inertial continuous delay larger + # than half a period incorrectly suppresses the whole clock. + f'reg pin_clk; always @(clk) pin_clk <= #{clock_skew} clk;\n' + f'always @(negedge pin_clk) begin\n drive <= #{return_delay} (valid[0]?pipe[0]:16\'hzzzz);') + assert 'reg pin_clk' in bench + (folder / 'tb.sv').write_text(bench) + cmd = [str(args.suite / 'bin' / ('iverilog' + ext)), '-g2012', '-s', 'video_sdram_tb', '-o', str(folder / 'run.vvp'), + str(folder / 'tb.sv'), str(out / 'fetch.sv'), str(folder / 'reference.sv'), str(folder / 'candidate.sv')] + with (folder / 'compile.log').open('w') as log: + subprocess.run(cmd, env=env, stdout=log, stderr=subprocess.STDOUT, check=True) + with (folder / 'run.log').open('w') as log: + r = subprocess.run([str(args.suite / 'bin' / ('vvp' + ext)), str(folder / 'run.vvp')], + env=env, stdout=log, stderr=subprocess.STDOUT, timeout=180) + result = {'corner': corner, 'extra_ready_cycle': extra_ready, 'clock_skew_ns': clock_skew, + 'return_delay_ns': return_delay, 'exit_code': r.returncode, + 'command_delay_ns': command_delay, + 'physical_launch_cycles': physical_launch_cycles, + 'native_extra_cycle': native_extra, 'is_ready_mutant': extra_ready != native_extra, + 'log_tail': (folder / 'run.log').read_text().strip().splitlines()[-2:], + 'log_sha256': hashlib.sha256((folder / 'run.log').read_bytes()).hexdigest()} + expected_pass = ((corner == 'logical') != bool(extra_ready)) if args.legacy_extra_launch_cycle else not extra_ready + signatures = ['video data channel='] + (['CPU read data mismatch'] if args.check_cpu_data else []) + if (r.returncode == 0) != expected_pass or (r.returncode and not any(s in (folder / 'run.log').read_text() for s in signatures)): + raise RuntimeError(f'Unexpected read-window control result: {corner}/{extra_ready}') + records.append(result) + print(json.dumps(result), flush=True) + (out / 'result.json').write_text(json.dumps({'source_sha256': hashlib.sha256(source.read_bytes()).hexdigest(), + 'bench_sha256': hashlib.sha256((ROOT / 'tests/video_sdram_tb.sv').read_bytes()).hexdigest(), + 'controller_normalizer_sha256': hashlib.sha256((ROOT / 'scripts/test_video_sdram.py').read_bytes()).hexdigest(), + 'generator_sha256': hashlib.sha256(Path(__file__).read_bytes()).hexdigest(), + 'scope': 'read bursts / line oracle, no write timing or analog model', 'controls_verified': True, + 'cpu_data_oracle': args.check_cpu_data, + 'legacy_extra_launch_cycle': args.legacy_extra_launch_cycle, + 'native_read_window_passed': all(r['exit_code'] == 0 for r in records if not r['is_ready_mutant']), + 'results': records}, indent=2) + '\n') + + +if __name__ == '__main__': + main() diff --git a/scripts/test_external_sdram_commands.py b/scripts/test_external_sdram_commands.py new file mode 100644 index 0000000..eda7433 --- /dev/null +++ b/scripts/test_external_sdram_commands.py @@ -0,0 +1,54 @@ +#!/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() diff --git a/scripts/test_keyboard_control_phase.py b/scripts/test_keyboard_control_phase.py new file mode 100644 index 0000000..60f65b6 --- /dev/null +++ b/scripts/test_keyboard_control_phase.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +"""Compare the exact keyboard row against upstream with the stated control delay.""" +import argparse +import hashlib +import json +import os +from pathlib import Path +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 build/ output') + output.mkdir(parents=True) + original=original_sources('coco3-mister')/'rtl/coco3fpga.sv';candidate=args.project/'rtl/coco3fpga.sv' + def row(text,start):return text[text.index(start):text.index('assign KEYBOARD_IN[7]')] + reference=row(original.read_text(),'assign KEYBOARD_IN[6] =') + actual=row(candidate.read_text(),'// Research: phase-match the remaining CPU keyboard control flags.') + header='input [3:0] controls,input [72:0] KEY,input [7:0] KEY_COLUMN,output y);\nwire EE_N=controls[3],MUGS=controls[2],SHIFT=controls[1],SHIFT_OVERRIDE=controls[0];\nwire [7:0] KEYBOARD_IN;wire [7:0] BUTTON_N={7\'d0,EE_N};\n' + source=output/'actual-keyboard.sv' + source.write_text('module actual_keyboard_controls(input clk_sys,'+header+actual+'\nassign y=KEYBOARD_IN[6];endmodule\nmodule reference_keyboard_controls('+header+reference+'\nassign y=KEYBOARD_IN[6];endmodule\n',encoding='utf-8') + bench=ROOT/'tests/keyboard_control_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','keyboard_control_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()) + (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 [original,candidate,bench,source,Path(__file__),output/'test.log']}},indent=2)+'\n',encoding='utf-8') + + +if __name__=='__main__':main() diff --git a/scripts/test_peripheral_phase.py b/scripts/test_peripheral_phase.py new file mode 100644 index 0000000..8cb14b2 --- /dev/null +++ b/scripts/test_peripheral_phase.py @@ -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() diff --git a/scripts/test_registered_interfaces.py b/scripts/test_registered_interfaces.py new file mode 100644 index 0000000..0021024 --- /dev/null +++ b/scripts/test_registered_interfaces.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 +"""Test new request boundary with actual SDRAM controller and complete boot logic.""" +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 boot_declarations(text): + constants=re.findall(r'^localparam\s+inst_\w+\s*=[^;]+;',text,re.M) + for declaration in constants: + text=text.replace(declaration,'',1) + position=re.search(r'localparam\s+EE_PROG',text).start() + return text[:position]+'\n'.join(constants)+'\n'+text[position:] + + +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 directory inside build/') + output.mkdir(parents=True) + # Icarus does not accept procedural assignment to Quartus's inout reg. + # Model that exact bidirectional driver with an internal reg + continuous wire. + controller=args.project/'rtl/sdram/sdram2.sv' + text=controller.read_text() + text=text.replace('inout reg [15:0] SDRAM_DQ','inout wire [15:0] SDRAM_DQ',1) + text=text.replace('assign SDRAM_nCS = 0;', 'reg [15:0] dq_drive;\nassign SDRAM_DQ = dq_drive;\nassign SDRAM_nCS = 0;',1) + text=text.replace('SDRAM_DQ <=','dq_drive <=') + # Icarus requires these part-select/continuous-assignment operands declared + # before use. Move declarations only, retaining width and all behavior. + declarations=[] + for name in ['command','dq_reg']: + declaration=re.search(r'^reg\s+\[[^\]]+\]\s+'+name+r';',text,re.M).group(0) + text=text.replace(declaration,'',1) + declarations.append(declaration) + text=text.replace('reg [15:0] dq_drive;', '\n'.join(declarations)+'\nreg [15:0] dq_drive;',1) + # The unused board clock-output DDIO primitive has no effect on controller + # state or this bench's constant read bus; model its configured inversion. + text=text[:text.index('\naltddio_out')]+ '\nassign SDRAM_CLK = ~clk;\nendmodule\n' + normalized=output/'sdram-icarus.sv' + normalized.write_text(text,encoding='utf-8') + original=original_sources('coco3-mister')/'rtl/EE_Cold_Bt.v' + reference=output/'boot-reference.v' + reference.write_text(boot_declarations(original.read_text()).replace('module EE_Cold_Bt','module EE_Cold_Bt_reference',1),encoding='utf-8') + boot_candidate=output/'boot-candidate.v' + boot_candidate.write_text(boot_declarations((args.project/'rtl/EE_Cold_Bt.v').read_text()),encoding='utf-8') + 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 '' + results={} + for name,files in [('bridge_protocol_tb',[ROOT/'tests/bridge_protocol_tb.sv',args.project/'rtl/cpu_sdram_bridge.sv']),('cpu_sdram_bridge_tb',[ROOT/'tests/cpu_sdram_bridge_tb.sv',args.project/'rtl/cpu_sdram_bridge.sv',normalized]),('boot_control_tb',[ROOT/'tests/boot_control_tb.sv',boot_candidate,reference])]: + with (output/(name+'-compile.log')).open('w') as file: + subprocess.run([str(args.suite/'bin'/('iverilog'+ext)),'-g2012','-s',name,'-o',str(output/(name+'.vvp')),*map(str,files)],env=env,stdout=file,stderr=subprocess.STDOUT,check=True) + log=output/(name+'.log') + with log.open('w') as file: + subprocess.run([str(args.suite/'bin'/('vvp'+ext)),str(output/(name+'.vvp'))],env=env,stdout=file,stderr=subprocess.STDOUT,check=True) + print(log.read_text(),flush=True) + results[name]={'sha256':{str(p):hashlib.sha256(p.read_bytes()).hexdigest() for p in [*files,log]}} + results['hardware_tested']=False + results['sdram_model_limit']='Actual RTL controller; inout-reg driver adaptation and unused clock-output DDIO model; constant read bus, no physical SDRAM array/timing model' + (output/'test-result.json').write_text(json.dumps(results,indent=2)+'\n',encoding='utf-8') + + +if __name__=='__main__':main() diff --git a/scripts/test_reset_domains.py b/scripts/test_reset_domains.py new file mode 100644 index 0000000..bffba24 --- /dev/null +++ b/scripts/test_reset_domains.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +"""Test exact consumer reset chains and disk-buffer pipeline cadence contracts.""" +import argparse +import hashlib +import json +import os +from pathlib import Path +import subprocess + +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 directory inside build/') + output.mkdir(parents=True) + core=(args.project/'rtl/coco3fpga.sv').read_text() + start=core.index('(* preserve *) reg [1:0] reset_main_release') + end=core.index('reg\t\t[6:0]\tCPU_RESET_SM;',start) + block=core[start:end] + for name in ['RESET_N','RESET_POS_N','RESET_FAST_N']: + block=block.replace('wire '+name+' =','assign '+name+' =') + stages='module actual_reset_domains(input clk_sys,CLK_114,RESET_RAW_N,output RESET_N,RESET_POS_N,RESET_FAST_N);\n'+block+'\nendmodule\n' + fdc=(args.project/'rtl/fdc.sv').read_text() + start=fdc.index('(* preserve *) reg [1:0] wd_reset_release') + end=fdc.index('always@',start) + stages+='module actual_wd_release(input CLK,RESET_N,output WD_RESET_N);\n'+fdc[start:end]+'\nassign WD_RESET_N=wd_reset_release[1];\nendmodule\n' + if '// Research: matching fast-clock' in core: + start=core.index('// Research: matching fast-clock') + end=core.index('localparam Sz_512K',start) + block=core[start:end].replace('reg data_ready_phase;','').replace('reg [15:0] hold_data_phase;','') + stages+='module actual_completion(input CLK_114,clear_data_ready,sdram_cpu_ready,input [15:0] sdram_dout,output reg data_ready_phase,output reg [15:0] hold_data_phase);\nreg data_ready;reg [15:0] hold_data;\n'+block+'\nendmodule\n' + sdc=(args.project/'rtl/sdc.sv').read_text() + wd=(args.project/'rtl/wd1793.sv').read_text() + if '(* preserve *) reg [7:0] cpu_buffer_pipe;' in sdc: + start=sdc.index('(* preserve *) reg [7:0] cpu_buffer_pipe;') + end=sdc.index('sdc_dpram hd_buff',start) + stages+='module actual_sdc_pipeline(input CLK,input [7:0] hd_buff_data_raw,output [7:0] hd_buff_data);\n'+sdc[start:end]+'\nendmodule\n' + else: + assert '.q_b(hd_buff_data)' in sdc and 'always_ff@(negedge clock)' in sdc + stages+='module actual_sdc_pipeline(input CLK,input [7:0] hd_buff_data_raw,output [7:0] hd_buff_data); assign hd_buff_data=hd_buff_data_raw; endmodule\n' + if '(* preserve *) reg [7:0] cpu_buffer_pipe;' in wd: + start=wd.index('(* preserve *) reg [7:0] cpu_buffer_pipe;') + end=wd.index('always @*',start) + stages+='module actual_wd_pipeline(input clk_sys,RWMODE,input [7:0] buff_dout,buff_din,output [7:0] q);\n'+wd[start:end]+'\nassign q=cpu_buffer_pipe;\nendmodule\n' + else: + assert 'buff_rd ? (RWMODE ? buff_dout : buff_din) :' in wd + stages+='module actual_wd_pipeline(input clk_sys,RWMODE,input [7:0] buff_dout,buff_din,output [7:0] q); assign q=RWMODE?buff_dout:buff_din; endmodule\n' + # Verify the actual wrapper inversion, not just the leaf module clock name. + for name,count in [('fdc.sv',4),('sdc_top.sv',2)]: + if (args.project/'rtl'/name).read_text().count('.clk_sys(~CLK)')!=count:raise RuntimeError('WD clock binding changed') + stages+=sdc[sdc.index('module sdc_dpram'):]+'\n'+wd[wd.index('module wd1793_dpram'):] + source=output/'actual-domains-buffers.sv';source.write_text(stages,encoding='utf-8') + 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 '';results={} + cases=[('domains','reset_domains_tb',False),('buffers','disk_buffer_pipeline_tb',False),('buffers-negative','disk_buffer_pipeline_tb',True)] + if 'module actual_completion' in stages:cases.append(('completion','completion_phase_tb',False)) + for name,top,negative in cases: + bench=ROOT/'tests'/(top+'.sv') + with (output/(name+'-compile.log')).open('w') as log: + subprocess.run([str(args.suite/'bin'/('iverilog'+ext)),'-g2012',*(['-DNEGATIVE_CONSECUTIVE'] if negative else []),'-s',top,'-o',str(output/(name+'.vvp')),str(bench),str(source)],env=env,stdout=log,stderr=subprocess.STDOUT,check=True) + log=output/(name+'.log') + with log.open('w') as file:run=subprocess.run([str(args.suite/'bin'/('vvp'+ext)),str(output/(name+'.vvp'))],env=env,stdout=file,stderr=subprocess.STDOUT) + text=log.read_text();print(text,flush=True) + if negative: + if run.returncode==0 or not any(message in text for message in ['CPU observed stale disk buffer','unsupported consecutive CPU disk read']):raise RuntimeError('Unsupported consecutive-enable negative control missing') + print('PASS negative control: CPU buffer read phases require the proven nonconsecutive enable contract') + elif run.returncode:raise RuntimeError('Regression failed: '+name) + results[name]={'exit':run.returncode,'sha256':{str(p):hashlib.sha256(p.read_bytes()).hexdigest() for p in [bench,source,log]}} + results['hardware_tested']=False + (output/'test-result.json').write_text(json.dumps(results,indent=2)+'\n',encoding='utf-8') + + +if __name__=='__main__':main() diff --git a/scripts/test_ssc_mister_system.py b/scripts/test_ssc_mister_system.py new file mode 100644 index 0000000..f25f9c3 --- /dev/null +++ b/scripts/test_ssc_mister_system.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 +"""Test actual prepared core SSC instantiations, without replacing chip logic.""" +import argparse +import hashlib +import json +import os +from pathlib import Path +import re +import subprocess +import threading +from validation_common import ROOT,digest +from rom_inputs import ROM_IDENTITIES,verified_rom + + +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();project=args.project.resolve();output=args.output.resolve();suite=args.suite.resolve() + if output.exists() or not output.is_relative_to((ROOT / 'build').resolve()):parser.error('Use a fresh build/ output') + output.mkdir(parents=True);core=project / 'rtl/coco3fpga.sv';text=core.read_text() + top=project / 'CoCo3.sv';top_text=top.read_text() + pll=re.search(r'\bpll\s+pll\s*\((.*?)\);',top_text,re.S) + lock=re.search(r'\.locked\(\s*(\w+)\s*\)',pll[1]) if pll else None + reset_binding=re.search(r'\.SSC_POWER_RESET\(ssc_power_reset\)',top_text) + if not lock or not reset_binding or not re.search(r'always\s*@\(posedge clk_sys or negedge '+re.escape(lock[1])+r'\)\s*if\(!'+re.escape(lock[1])+r'\) ssc_power_release <= 2\x27b00;',top_text): + raise RuntimeError('SSC power reset is not driven by the actual core PLL lock output') + if "else ssc_power_release <= {ssc_power_release[0],1'b1};" not in top_text or 'wire ssc_power_reset = !ssc_power_release[1];' not in top_text: + raise RuntimeError('SSC power reset release contract changed') + if not re.search(r'\.SSC_MODE\(status\[42\]\)',top_text):raise RuntimeError('SSC menu mode binding changed') + if not re.search(r'assign\s+DATA_IN\s*=\s*ssc_read_valid\s*\?\s*ssc_read_data\s*:',text):raise RuntimeError('SSC CPU read-priority binding changed') + declarations=text[text.index('wire ssc_palette_owner,'):text.index('wire [15:0] ssc_legacy_left,ssc_legacy_right;')+len('wire [15:0] ssc_legacy_left,ssc_legacy_right;')] + body=text[text.index('assign ssc_legacy_left ='):text.index('.debug_pc(ssc_debug_pc));')+len('.debug_pc(ssc_debug_pc));')] + routing='' + if 'bh_mpi_router mpi_router' in text: + start=text.index('wire [2:0] mpi_rom_kind,mpi_io_kind;') + end=text.index("wire [7:0] mpi_orch_right=mpi_orchestra_present?ORCH_RIGHT:8'h80;",start) + routing="wire MPI_BOOT_LOADING=0;\nwire [1:0] MPI_CTS=0,MPI_SCS=0;\n"+text[start:end+len("wire [7:0] mpi_orch_right=mpi_orchestra_present?ORCH_RIGHT:8'h80;")] + generated=output / 'actual-bindings.sv' + power_start=top_text.index('(* preserve, altera_attribute',top_text.index('// Cartridge ROM validity')) + power_end=top_text.index('wire ssc_power_reset = !ssc_power_release[1];',power_start)+len('wire ssc_power_reset = !ssc_power_release[1];') + power_block=top_text[power_start:power_end].replace('wire ssc_power_reset =','assign ssc_power_reset =') + generated.write_text('module actual_ssc_power_reset(input clk_sys,'+lock[1]+',output ssc_power_reset);\n'+power_block+'\nendmodule\n'+'''module actual_ssc_mister_system(input clk_sys,SSC_POWER_RESET,RESET_POS_N,SSC_MODE,PH_2,RW_N, +input [15:0] ADDRESS,input [7:0] DATA_OUT,input [11:0] MPI_LAYOUT,input ioctl_download,ioctl_wr,input [15:0] ioctl_index, +input [24:0] ioctl_addr,input [7:0] ioctl_data,input SOUND_EN,input [1:0] SEL, +input [7:0] ORCH_LEFT,ORCH_RIGHT,SOUND,output SSC_READY,SSC_FAULT, +output [15:0] SOUND_LEFT,SOUND_RIGHT,output READ_VALID,output [7:0] READ_DATA,output PALETTE_OWNER); +'''+routing+'\n'+declarations+'\n'+body+''' +assign READ_VALID=ssc_read_valid;assign READ_DATA=ssc_read_data;assign PALETTE_OWNER=ssc_palette_owner; +endmodule +''',encoding='utf-8',newline='\n') + folder=project / 'rtl/ssc';sources=sorted(folder.glob('*.sv'));bench=ROOT / 'tests/ssc_mister_system_tb.sv' + if routing:sources.append(project/'rtl/bh_mpi_router.sv') + paths=[Path(__file__),ROOT / 'scripts/validation_common.py',ROOT / 'scripts/rom_inputs.py',core,top,generated,bench,*sources,*folder.glob('*.vh')] + hashes={str(p):digest(p) for p in paths};roms=ROOT / 'roms/ssc' + identities={name:verified_rom(roms / name,value) for name,value in ROM_IDENTITIES.items()} + env=os.environ.copy();env['PATH']=os.pathsep.join([str(suite / 'bin'),str(suite / 'lib'),env['PATH']]);ext='.exe' if os.name=='nt' else '';binary=output / 'system.vvp' + with (output / 'compile.log').open('w') as log: + subprocess.run([str(suite / 'bin' / ('iverilog'+ext)),'-g2012','-I',str(folder),'-s','ssc_mister_system_tb','-o',str(binary),str(bench),str(generated),*map(str,sources)],env=env,stdout=log,stderr=subprocess.STDOUT,check=True) + process=subprocess.Popen([str(suite / 'bin' / ('vvp'+ext)),str(binary),'+PIC_PATH='+(roms / 'pic-7040-510.bin').as_posix(),'+SPEECH_PATH='+(roms / 'sp0256-al2.bin').as_posix()],cwd=output,env=env,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,text=True,bufsize=1) + timer=threading.Timer(900,process.kill);timer.start();summary=None + try: + with (output / 'rtl.log').open('w') as log: + for line in process.stdout: + print(line.rstrip(),flush=True);log.write(line);log.flush() + if line.startswith('RESULT '):summary=json.loads(line[7:]) + code=process.wait() + finally: + timer.cancel() + if process.poll() is None:process.kill();process.wait() + if code or not summary or not summary['passed']:raise RuntimeError('Actual core SSC bindings failed; inspect rtl.log') + if any(digest(Path(p))!=h for p,h in hashes.items()):raise RuntimeError('Actual core/test source changed during run') + for name,value in ROM_IDENTITIES.items():verified_rom(roms / name,value) + hashes.update({str(p):digest(p) for p in output.glob('*.log')}) + (output / 'test-result.json').write_text(json.dumps({'passed':True,'roms':identities,'summary':summary,'sha256':hashes, + 'hardware_tested':False,'scope':'Actual extracted prepared-core SSC bindings with real chip RTL; CPU/HPS stimulus, not full CoCo CPU/vendor-IP or physical run'},indent=2)+'\n',encoding='utf-8',newline='\n') + + +if __name__=='__main__':main() diff --git a/scripts/test_video_sdram.py b/scripts/test_video_sdram.py new file mode 100644 index 0000000..5acc34a --- /dev/null +++ b/scripts/test_video_sdram.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +"""Compare real video fetch/controller behavior before and after activation staging.""" +import argparse +import hashlib +import json +import os +from pathlib import Path +import re +import subprocess + +ROOT = Path(__file__).resolve().parents[1] + + +def normalize_controller(text, name): + # Same driver/declaration adaptation as test_registered_interfaces.py. + text = text.replace('module sdram_32r8w', 'module ' + name, 1) + text = text.replace('inout reg [15:0] SDRAM_DQ', 'inout wire [15:0] SDRAM_DQ', 1) + declarations = [] + for register in ('command', 'dq_reg'): + declaration = re.search(r'^reg\s+\[[^\]]+\]\s+' + register + r';', text, re.M).group() + text = text.replace(declaration, '', 1) + declarations.append(declaration) + text = text.replace('assign SDRAM_nCS = 0;', '\n'.join(declarations) + + '\nreg [15:0] dq_drive;\nassign SDRAM_DQ = dq_drive;\nassign SDRAM_nCS = 0;', 1) + text = text.replace('SDRAM_DQ <=', 'dq_drive <=') + return text[:text.index('\naltddio_out')] + '\nassign SDRAM_CLK = ~clk;\nendmodule\n' + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('reference', type=Path) + parser.add_argument('candidate', 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 fresh output directory inside build/') + output.mkdir(parents=True) + sources = [] + for name, project in [('reference', args.reference), ('candidate', args.candidate)]: + path = project / 'rtl/sdram/sdram2.sv' + sources.append(path) + (output / (name + '.sv')).write_text(normalize_controller(path.read_text(), 'sdram_' + name), encoding='utf-8') + fetch = args.candidate / 'rtl/coco_mem_fetch.sv' + sources.append(fetch) + if fetch.read_bytes() != (args.reference / 'rtl/coco_mem_fetch.sv').read_bytes(): + raise RuntimeError('This comparison expects an unchanged video fetcher') + text = fetch.read_text() + # Quartus accepts procedural assignment to these implicit output nets; + # Icarus needs the explicit variable type. No expression/state edits. + for name in ('SDRAM_VID_REQ', 'BUFF_ADD', 'BUFF_DATA_O', 'BUFFER_WRITE'): + text, n = re.subn(r'(output\s+)(?!reg)(\[[^\]]+\]\s*)?(' + name + r'\b)', r'\1reg \2\3', text, count=1) + if n != 1: + raise RuntimeError('Unexpected fetch output declaration: ' + name) + text = re.sub(r'wire(\s+\[2:0\]\s+BUF_HBORDER;)', r'reg\1', text, count=1) + (output / 'fetch.sv').write_text(text, encoding='utf-8') + bench = ROOT / 'tests/video_sdram_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 '' + command = [str(args.suite / 'bin' / ('iverilog' + ext)), '-g2012', '-s', 'video_sdram_tb', + '-o', str(output / 'test.vvp'), str(bench), *map(str, output.glob('*.sv'))] + for name, project in [('REFERENCE', args.reference), ('CANDIDATE', args.candidate)]: + extra = re.search(r'localparam READ_CAPTURE_EXTRA\s*=\s*(\d+)', (project / 'rtl/sdram/sdram2.sv').read_text()) + if extra: + # Model a declared extra return cycle, independently of the FSM. + command.insert(1, '-D' + name + '_RETURN_DELAY=' + str(10 * int(extra[1]))) + with (output / 'compile.log').open('w') as log: + subprocess.run(command, 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, timeout=180) + print((output / 'test.log').read_text()) + # An actual address error must be caught by the data oracle. Keep the + # perturbation solely in this generated simulation copy. + negative = output / 'candidate.sv' + original = negative.read_text() + corrupted, changed = re.subn(r'video_address_snapshot\[24:1\]', + r'{video_address_snapshot[24:2],~video_address_snapshot[1]}', original) + if changed != 1: + raise RuntimeError('Expected exactly one video activation address') + negative.write_text(corrupted, encoding='utf-8') + try: + negative_command = command.copy() + negative_command[negative_command.index('-o') + 1] = str(output / 'negative.vvp') + with (output / 'negative-compile.log').open('w') as log: + subprocess.run(negative_command, env=env, stdout=log, stderr=subprocess.STDOUT, check=True) + with (output / 'negative.log').open('w') as log: + failed = subprocess.run([str(args.suite / 'bin' / ('vvp' + ext)), str(output / 'negative.vvp')], + env=env, stdout=log, stderr=subprocess.STDOUT, timeout=180) + if failed.returncode == 0 or 'video data channel=1' not in (output / 'negative.log').read_text(): + raise RuntimeError('Corrupted video-address negative control did not fail as expected') + finally: + negative.write_text(original, encoding='utf-8') + print('PASS negative control: corrupting the candidate video address fails the data oracle') + hashes = {str(p): hashlib.sha256(p.read_bytes()).hexdigest() for p in [*sources, bench, Path(__file__)]} + (output / 'test-result.json').write_text(json.dumps({ + 'passed': True, 'negative_control_passed': True, 'hardware_tested': False, 'input_sha256': hashes, + 'model_limit': 'Logical SDRAM read-command/CL3/two-word burst model; no electrical/device timing or video pixel rendering.', + 'log': (output / 'test.log').read_text(), + }, indent=2) + '\n', encoding='utf-8') + + +if __name__ == '__main__': + main() diff --git a/scripts/uart_timing_paths.tcl b/scripts/uart_timing_paths.tcl new file mode 100644 index 0000000..845d6d6 --- /dev/null +++ b/scripts/uart_timing_paths.tcl @@ -0,0 +1,50 @@ +# Fitted UART diagnostics, both timing corners; no changes to project assignments. +# quartus_sta -t uart_timing_paths.tcl PROJECT REVISION OUTPUT_DIRECTORY +package require ::quartus::project +package require ::quartus::sta +set project [lindex $quartus(args) 0] +set revision [lindex $quartus(args) 1] +set output [file normalize [lindex $quartus(args) 2]] +file mkdir $output +project_open $project -revision $revision +foreach model {slow fast} { + create_timing_netlist -model $model + read_sdc + update_timing_netlist + # Include the MiSTer wrapper's enable generator/reset chain, not just RS232. + set uart [get_registers {*RS232|* *COM1|* *|CLK_6551* *|uart_tick_release* dw_top_release[*] dw_mode* dw_base_d COM1_CLOCK* COM1_STATE* COM1_CLK*}] + if {[get_collection_size $uart] == 0} {error "Expected fitted UART registers"} + puts "UART_REGISTERS $model [get_collection_size $uart]" + foreach check {setup hold recovery removal} { + report_timing -$check -npaths 3 -detail full_path \ + -file [file join $output global-${model}-${check}.rpt] + report_timing -$check -to $uart -npaths 20 -detail full_path \ + -file [file join $output uart-${model}-${check}.rpt] + report_timing -$check -from $uart -npaths 10 -detail full_path \ + -file [file join $output uart-out-${model}-${check}.rpt] + } + set cfg [get_registers {*RS232|CTL_REG[*] *RS232|CMD_REG[*] *COM1|CTL_REG[*]}] + report_timing -setup -from $cfg -to $uart -npaths 10 -detail full_path \ + -file [file join $output uart-config-${model}-setup.rpt] + report_timing -hold -from $cfg -to $uart -npaths 10 -detail full_path \ + -file [file join $output uart-config-${model}-hold.rpt] + if {$model eq "slow"} { + set audit [open [file join $output uart-register-clocks.tsv] w] + puts $audit "register\tclock_pin\tclock_driver" + foreach_in_collection reg $uart { + foreach edge [get_register_info -clock_edges $reg] { + set source [get_edge_info -src $edge] + foreach input_edge [get_node_info -clock_edges $source] { + set driver [get_edge_info -src $input_edge] + puts $audit "[get_register_info -name $reg]\t[get_node_info -name $source]\t[get_node_info -name $driver]" + } + } + } + close $audit + report_clocks -file [file join $output clocks.rpt] + report_ucp -file [file join $output unconstrained.rpt] + report_clock_transfers -file [file join $output clock-transfers.rpt] + } + delete_timing_netlist +} +project_close diff --git a/scripts/validation_common.py b/scripts/validation_common.py new file mode 100644 index 0000000..cf4754c --- /dev/null +++ b/scripts/validation_common.py @@ -0,0 +1,25 @@ +import hashlib, os, shutil, subprocess +from pathlib import Path +ROOT=Path(__file__).resolve().parents[1] +def digest(path):return hashlib.sha256(path.read_bytes()).hexdigest() + +def cpp_environment(output): + env = os.environ.copy() + if os.name != 'nt': + return os.environ.get('CXX', 'c++'), env + finder = Path(os.environ.get('ProgramFiles(x86)', r'C:\Program Files (x86)')) / 'Microsoft Visual Studio/Installer/vswhere.exe' + vs = subprocess.check_output([str(finder), '-latest', '-version', '[17.0,18.0)', + '-products', '*', '-requires', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', + '-property', 'installationPath'], text=True).strip() + if not vs or any(c in vs for c in '%!"&^<>\r\n'): + raise RuntimeError('No usable VS2022 C++ toolchain') + batch = output / 'vs-environment.cmd' + batch.write_text(f'@echo off\ncall "{vs}/Common7/Tools/VsDevCmd.bat" -arch=x64 -host_arch=x64 >nul\nif errorlevel 1 exit /b %errorlevel%\nset\n', encoding='utf-8') + setup = subprocess.check_output([os.environ.get('COMSPEC', 'cmd.exe'), '/d', '/c', str(batch)], text=True, errors='replace') + # Developer environment may contain private values; never print or save it. + env.update((key.upper(), value) for key, value in + (line.split('=', 1) for line in setup.splitlines() if '=' in line and not line.startswith('='))) + compiler = shutil.which('cl.exe', path=env['PATH']) + if not compiler: + raise RuntimeError('VS environment did not provide cl.exe') + return compiler, env diff --git a/scripts/video_timing_paths.tcl b/scripts/video_timing_paths.tcl new file mode 100644 index 0000000..2af7845 --- /dev/null +++ b/scripts/video_timing_paths.tcl @@ -0,0 +1,43 @@ +# quartus_sta -t video_timing_paths.tcl PROJECT REVISION OUTPUT_DIRECTORY +package require ::quartus::project +package require ::quartus::sta +set project [lindex $quartus(args) 0] +set revision [lindex $quartus(args) 1] +set output [file normalize [lindex $quartus(args) 2]] +file mkdir $output +project_open $project -revision $revision +foreach model {slow fast} { + create_timing_netlist -model $model + read_sdc + update_timing_netlist + set snapshot [get_registers {*coco3_sdram|video_address_snapshot[*]*}] + set fetch [get_registers {*video_fetch|*}] + set controller [get_registers {*coco3_sdram|*}] + set source [get_registers {*MISTER_COCOVID|ROW_ADD[*]* *MISTER_COCOVID|SCREEN_START_ADD[*]*}] + foreach {name collection minimum} [list snapshot $snapshot 20 fetch $fetch 10 controller $controller 40 source $source 20] { + set count [get_collection_size $collection] + puts "VIDEO_SCOPE $model $name $count" + if {$count < $minimum} {error "Incomplete video timing scope: $name"} + } + foreach check {setup hold} { + report_timing -$check -from $source -to $snapshot -npaths 30 -detail full_path \ + -file [file join $output address-${model}-${check}.rpt] + report_timing -$check -from $snapshot -to $controller -npaths 30 -detail full_path \ + -file [file join $output activation-${model}-${check}.rpt] + report_timing -$check -to $fetch -npaths 30 -detail full_path \ + -file [file join $output fetch-in-${model}-${check}.rpt] + report_timing -$check -from $fetch -npaths 30 -detail full_path \ + -file [file join $output fetch-out-${model}-${check}.rpt] + report_timing -$check -to $controller -npaths 30 -detail full_path \ + -file [file join $output controller-in-${model}-${check}.rpt] + report_timing -$check -from $controller -npaths 30 -detail full_path \ + -file [file join $output controller-out-${model}-${check}.rpt] + } + if {$model eq "slow"} { + report_clocks -file [file join $output clocks.rpt] + report_ucp -file [file join $output unconstrained.rpt] + report_exceptions -file [file join $output exceptions.rpt] + } + delete_timing_netlist +} +project_close diff --git a/sys/i2c.v b/sys/i2c.v index 6da6a14..3faec14 100644 --- a/sys/i2c.v +++ b/sys/i2c.v @@ -1,3 +1,5 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. module i2c ( @@ -24,6 +26,12 @@ parameter CLK_Freq = 50_000_000; // 50 MHz parameter I2C_Freq = 400_000; // 400 KHz localparam I2C_FreqX2 = I2C_Freq*2; +// Wait >=400 ns after the generated falling edge before changing SDA. +// This covers a fast-mode 300 ns SCL fall plus 40 ns fabric skew; the +// former four-clock (80 ns at 50 MHz) pipeline could change data while the +// external SCL was still high. Minimum two stages keeps the slice valid. +localparam SDA_DELAY_STAGES = (CLK_Freq >= 5_000_000) ? + (CLK_Freq + 2_500_000 - 1)/2_500_000 : 2; reg I2C_CLOCK; reg [31:0] cnt; @@ -38,10 +46,10 @@ always @(posedge CLK) begin end assign I2C_SCL = (SCLK | I2C_CLOCK) ? 1'bZ : 1'b0; -assign I2C_SDA = SDO[3] ? 1'bz : 1'b0; +assign I2C_SDA = SDO[SDA_DELAY_STAGES-1] ? 1'bz : 1'b0; reg SCLK; -reg [3:0] SDO; +reg [SDA_DELAY_STAGES-1:0] SDO; reg [0:7] rdata; reg [5:0] SD_COUNTER; @@ -51,7 +59,7 @@ initial begin SD_COUNTER = 'b111111; SD = 'hFFFF; SCLK = 1; - SDO = 4'b1111; + SDO = {SDA_DELAY_STAGES{1'b1}}; end assign I2C_RDATA = rdata; @@ -66,11 +74,11 @@ always @(posedge CLK) begin // delay to make sure SDA changed while SCL is stabilized at low if(old_clk && ~I2C_CLOCK && ~SD_COUNTER[5]) SDO[0] <= SD[SD_COUNTER[4:0]]; - SDO[3:1] <= SDO[2:0]; + SDO[SDA_DELAY_STAGES-1:1] <= SDO[SDA_DELAY_STAGES-2:0]; if(~old_st && START) begin SCLK <= 1; - SDO <= 4'b1111; + SDO <= {SDA_DELAY_STAGES{1'b1}}; ACK <= 0; END <= 0; rd <= READ; diff --git a/sys/mcp23009.sv b/sys/mcp23009.sv index 82eaf37..8d89ea6 100644 --- a/sys/mcp23009.sv +++ b/sys/mcp23009.sv @@ -1,3 +1,5 @@ +// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. // // MCP23009 // (C) 2019 Alexey Melnikov @@ -24,7 +26,9 @@ reg rw; wire [7:0] dout; reg [15:0] din; -i2c #(50_000_000, 500_000) i2c +// Fast-mode profile: symmetric 2 us half-periods leave margin for the +// specified 1.3 us minimum low time, finite board edges and FPGA propagation. +i2c #(50_000_000, 250_000) i2c ( .CLK(clk), .START(start), diff --git a/tests/bh_mpi_core_tb.sv b/tests/bh_mpi_core_tb.sv new file mode 100644 index 0000000..b157ba6 --- /dev/null +++ b/tests/bh_mpi_core_tb.sv @@ -0,0 +1,120 @@ +`timescale 1ns/1ps +module bh_mpi_core_tb; +reg clk=0;always #5 clk=~clk; +reg power=1,reset_n=0,cart=0,internal_rom=1,commit=0,rnw=1; +reg [15:0] address=0;reg [1:0] rom_mode=0;reg [9:0] switches=6; +reg [7:0] cpu_data=0;reg [11:0] layout={3'd1,3'd1,3'd1,3'd1}; +reg boot_loading=0,download=0,wr=0;reg [15:0] file_index=6; +reg [24:0] file_address=0;reg [7:0] file_data=0; +reg ext_response=0,ser_irq=1,amw_trigger=0,amw_ready=0,amw_en=0; +wire [7:0] flash;wire fd,sd,serial,bankport,loading,loaded,restart,cart_irq; +wire [3:0] fault;wire [1:0] scs,cts; +actual_mpi_core dut(clk,power,reset_n,cart,internal_rom,commit,rnw,address, + rom_mode,switches,cpu_data,layout,boot_loading,download,wr,file_index,file_address,file_data, + ext_response,ser_irq,amw_trigger,amw_ready,amw_en,flash,fd,sd,serial,bankport, + fault,loading,loaded,restart,scs,cts,cart_irq); +integer n,i,j,c,r; +reg [7:0] expected; +function [7:0] pattern(input integer slot,input integer pos); + begin pattern=(slot*41)^(pos>>14)^8'hc7;end +endfunction +task tick;begin @(negedge clk);#1;end endtask +task write_port(input [15:0] port,input [7:0] value); + begin @(posedge clk);address=port;cpu_data=value;commit=1;rnw=0;tick; + @(posedge clk);commit=0;rnw=1;end +endtask +task route(input integer romslot,input integer ioslot); + begin write_port(16'hff7f,(romslot<<4)|ioslot);tick; + if(cts!==romslot[1:0]||scs!==ioslot[1:0])$fatal(1,"Independent FF7F selectors");end +endtask +task read_rom(input integer slot,input integer bank); + begin cart=1;internal_rom=0;address=16'hc100;rom_mode=0;repeat(2)tick; + expected=pattern(slot,bank*16384); + if(flash!==expected)$fatal(1,"Core ROM/bank mapping slot=%0d bank=%0d got=%h exp=%h",slot,bank,flash,expected); + cart=0;internal_rom=1;end +endtask +initial begin + repeat(4)tick;power=0;reset_n=1;repeat(3)tick; + if(cts!==3||scs!==3)$fatal(1,"Startup slot reset"); + // Original Main parses remembered FC files before loading the saved layout. + // Slot4 defaults to floppy but the persisted layout makes it a program ROM. + boot_loading=1;layout={3'd2,3'd1,3'd3,3'd6};repeat(3)tick; + @(posedge clk);file_index=9;download=1;wr=1;file_address=0;file_data=pattern(3,0);tick; + @(posedge clk);wr=0;download=0;repeat(4)tick; + if(dut.mpi_rom_valid[3]!==1'b1)$fatal(1,"FC9 lost before saved layout restoration"); + layout={3'd1,3'd2,3'd3,3'd6};repeat(3)tick;boot_loading=0;repeat(3)tick; + route(3,3);read_rom(3,0); + // Other remembered files must be discarded if their final socket is absent. + boot_loading=1;layout[5:3]=0;repeat(3)tick; + @(posedge clk);file_index=7;download=1;wr=1;file_address=0;file_data=pattern(1,0);tick; + @(posedge clk);wr=0;download=0;repeat(4)tick; + if(dut.mpi_rom_valid[1]!==1'b1)$fatal(1,"Startup staging did not retain FC7"); + boot_loading=0;repeat(3)tick; + if(dut.mpi_rom_valid[1]!==1'b0||dut.mpi_program_roms.owned[1]!==0) + $fatal(1,"Inactive remembered ROM survived final layout"); + layout={3'd1,3'd1,3'd1,3'd1};repeat(3)tick; + for(n=0;n<4;n=n+1)begin + @(posedge clk);file_index=6+n;download=1;wr=0;tick; + for(i=0;i<65536;i=i+1)begin + @(posedge clk);wr=1;file_address=i;file_data=pattern(n,i);tick; + end + @(posedge clk);wr=0;download=0;repeat(3)tick; + end + if(fault!==0)$fatal(1,"Program transfer fault"); + // Cold-start request must survive an arbitrarily delayed reset/sequencer. + repeat(100)tick;if(!dut.mpi_rom_cold_pending||restart)$fatal(1,"Restart pending lost/early"); + amw_ready=1;#1;if(restart!==1'b1)$fatal(1,"Ready sequencer missed deferred restart"); + amw_en=1;tick;amw_en=0;tick;if(restart)$fatal(1,"Restart did not retire on consume"); + for(n=0;n<4;n=n+1)begin + route(n,n);write_port(16'hff40,n);tick; + end + for(c=0;c<4;c=c+1)for(r=0;r<4;r=r+1)begin + route(c,r);write_port(16'hff40,r);read_rom(c,c); + address=16'hff40;#1; + if(bankport!==1'b1||dut.rom_banks[r]!==r[2:0])$fatal(1,"I/O bank route follows wrong socket"); + end + // Ordinary reset preserves inserted ROM bytes and zeroes each bank. + reset_n=0;repeat(3)tick;reset_n=1;repeat(3)tick; + for(n=0;n<4;n=n+1)begin route(n,0);read_rom(n,0);end + // Move each storage controller through every slot, retaining separate CTS. + for(n=0;n<4;n=n+1)begin + layout=0;layout[n*3+:3]=2; + for(c=0;c<4;c=c+1)for(r=0;r<4;r=r+1)begin + route(c,r);address=16'hff48;#1; + if(fd!==(r==n)||sd!==1'b0)$fatal(1,"Moved floppy decode"); + address=16'hff68;#1;if(serial!==(r==n))$fatal(1,"Serial companion decode"); + cart=1;internal_rom=0;address=16'hc100;repeat(2)tick; + if(flash!==(c==n?8'hd4:8'hff))$fatal(1,"Disk/empty ROM decode"); + cart=0;internal_rom=1; + end + layout[n*3+:3]=3; + for(r=0;r<4;r=r+1)begin + route(0,r);address=16'hff48;#1; + if(sd!==(r==n)||fd!==1'b0)$fatal(1,"Moved SDC decode"); + end + end + // The inherited OS9 SDC response workaround remains conditional on presence. + layout={3'd2,3'd0,3'd3,3'd0};route(3,3);address=16'hff48;ext_response=1;#1; + `ifdef CoCo3_sdc_fix_os9_driver + if(fd||!sd)$fatal(1,"OS9 SDC response priority lost"); + `else + if(!fd||sd)$fatal(1,"Unexpected OS9 override in ordinary build"); + `endif + layout={3'd2,3'd0,3'd0,3'd0};#1;if(!fd||sd)$fatal(1,"Absent SDC stole disk I/O"); + ext_response=0; + // A separately routed serial controller must still deliver its active-low + // interrupt while a program ROM owns CTS. + layout={3'd2,3'd1,3'd0,3'd0};route(2,3); + // Those earlier ROMs were intentionally removed by the device-layout tests. + // Insert a fresh program image before testing its concurrent serial IRQ. + @(posedge clk);file_index=8;download=1;wr=1;file_address=0;file_data=pattern(2,0);tick; + @(posedge clk);wr=0;download=0;repeat(4)tick; + if(!dut.mpi_rom_valid[2])$fatal(1,"Reinserted ROM did not load"); + ser_irq=0;commit=1;repeat(3)tick; + if(cart_irq!==1'b0)$fatal(1,"ROM presence masked serial IRQ"); + ser_irq=1;commit=0; + $display("PASS actual core MPI bindings: independent selectors/banks, four images, moved controllers, empty bus, OS9 compatibility, deferred restart and reset retention"); + $finish; +end +initial begin #10000000;$fatal(1,"Core binding watchdog");end +endmodule diff --git a/tests/bh_mpi_startup_tb.sv b/tests/bh_mpi_startup_tb.sv new file mode 100644 index 0000000..319fa6e --- /dev/null +++ b/tests/bh_mpi_startup_tb.sv @@ -0,0 +1,57 @@ +`timescale 1ns/1ps +// Original Main init: reset1, FC4/5/6/9 with status polls after each transfer, +// restore saved configuration with reset1, then Main's own reset0 release. +module bh_mpi_startup_tb; +reg clk=0;always #5 clk=~clk; +reg power=1;reg [63:0] requested=0; +wire [63:0] accepted,status_in;wire status_set; +bh_mpi_config cfg(clk,power,requested,accepted,status_in,status_set); +reg pending=0;reg [63:0] pending_value; +always @(posedge clk)if(status_set)begin pending<=1;pending_value<=status_in;end +reg download=0,wr=0;reg [15:0] file_index=0; +reg [24:0] file_address=0;reg [7:0] file_data=0; +wire [7:0] flash;wire [3:0] fault; +actual_mpi_core dut(.clk_sys(clk),.SSC_POWER_RESET(power),.RESET_N(!power), + .CART_SEL(1'b1),.ROM_SEL(1'b0),.PH_2(1'b0),.RW_N(1'b1),.ADDRESS(16'hc000), + .ROM(2'b0),.SWITCH(10'd6),.DATA_OUT(8'd0),.MPI_LAYOUT(accepted[54:43]), + .MPI_BOOT_LOADING(accepted[0]),.ioctl_download(download),.ioctl_wr(wr), + .ioctl_index(file_index),.ioctl_addr(file_address),.ioctl_data(file_data), + .ext_response(1'b0),.SER_IRQ(1'b1),.AMW_Trigger(1'b0),.AMW_Ready(1'b0), + .AMW_EN(1'b0),.FLASH_DATA(flash),.MPI_ROM_FAULT(fault)); +task tick;begin @(negedge clk);#1;end endtask +task host_poll; + begin + repeat(4)tick; + if(pending)begin + @(posedge clk);#1;requested=pending_value&~64'd1;pending=0; + repeat(4)tick; + end + end +endtask +task stream(input [15:0] index,input [7:0] value); + begin + @(posedge clk);#1;file_index=index;download=1;wr=1;file_address=0;file_data=value; + tick; + @(posedge clk);#1;download=0;wr=0;repeat(5)tick; + host_poll; + end +endtask +initial begin + repeat(4)tick;@(posedge clk);#1;power=0;requested=1;repeat(8)tick; + stream(4,8'h11); + if(requested[0]!==1'b1)$fatal(1,"Main status acknowledgement cleared init reset after FC4"); + stream(5,8'h22);stream(6,8'ha1);stream(9,8'hd4); + if(dut.mpi_rom_valid!==4'b1001)$fatal(1,"Startup streams discarded before saved layout: valid=%b fault=%b status=%h enabled=%b",dut.mpi_rom_valid,fault,accepted,dut.mpi_rom_enabled); + // Final saved layout differs from initial defaults: FD3 and ROM4. + @(posedge clk);#1;requested=accepted; + requested[54:43]={3'd1,3'd2,3'd3,3'd6};requested[13:12]=2; + repeat(8)tick;host_poll; + if(!requested[0])$fatal(1,"Premature status acknowledgement during saved reset"); + @(posedge clk);#1;requested[0]=0;repeat(10)tick;host_poll; + if(accepted[54:43]!=={3'd1,3'd2,3'd3,3'd6}||dut.mpi_rom_valid!==4'b1001||fault!==0) + $fatal(1,"Restored layout/ROMs lost or stale migration overwrote configuration"); + $display("PASS actual core MPI bindings: original Main init/status polls retain FC6/FC9 through saved layout restoration"); + $finish; +end +initial begin #100000;$fatal(1,"Main startup ordering watchdog");end +endmodule diff --git a/tests/bh_mpi_tb.sv b/tests/bh_mpi_tb.sv new file mode 100644 index 0000000..e84399f --- /dev/null +++ b/tests/bh_mpi_tb.sv @@ -0,0 +1,148 @@ +`timescale 1ns/1ps +module bh_mpi_tb; +reg clk=0;always #5 clk=~clk; +reg reset=1; +reg [63:0] requested=0; +wire [63:0] accepted,status_in;wire status_set; +bh_mpi_config cfg(clk,reset,requested,accepted,status_in,status_set); +reg [11:0] layout=0;reg [1:0] cts=0,scs=0; +wire [2:0] rk,ik;wire fd,sd,rom,serial,ssc,orch,fdp,sdp; +bh_mpi_router router(layout,cts,scs,rk,ik,fd,sd,rom,serial,ssc,orch,fdp,sdp); +reg [1:0] read_slot=0;reg [16:0] read_address=0; +reg download=0,wr=0;reg [7:0] file_index=0,data=0; +reg [24:0] address=0;wire [7:0] read_data; +wire loading,loaded;wire [3:0] valid,fault; +reg [3:0] enabled=15; +bh_mpi_rom memory(clk,reset,read_slot,read_address,read_data, + download,wr,file_index,address,data,loading,valid,fault,loaded,enabled); +integer l,c,s,n,k,j,routes=0; +reg [2:0] a,b; +reg expect_ssc,expect_orch,expect_fd,expect_sd; +reg [63:0] next_request,saved; +reg [7:0] expected_byte; +function [7:0] pattern(input integer slot,input integer location); + begin pattern=(location>>8)^(location>>14)^(slot*71)^8'h96;end +endfunction +task tick;begin @(posedge clk);#1;end endtask +task apply(input [63:0] value); + begin @(negedge clk);requested=value;repeat(8)tick;end +endtask +task change(input integer slot,input [2:0] device); + begin next_request=accepted;next_request[43+slot*3+:3]=device;apply(next_request);end +endtask +task boot; + begin @(negedge clk);reset=1;download=0;wr=0;repeat(3)tick; + @(negedge clk);reset=0;repeat(3)tick;end +endtask +task stream(input integer slot,input integer length,input integer bad_at); + begin + @(negedge clk);file_index=6+slot;download=1;wr=0;tick; + for(k=0;k>(n*3))&7; + if(a==4||a==6)expect_ssc=1; + if(a==5||a==6)expect_orch=1; + if(a==2)expect_fd=1; + if(a==3)expect_sd=1; + end + for(c=0;c<4;c=c+1)for(s=0;s<4;s=s+1)begin + cts=c;scs=s;#1;a=(l>>(c*3))&7;b=(l>>(s*3))&7; + if(rk!==a||ik!==b||fd!==(b==2)||sd!==(b==3)|| + rom!==((b==1)||(b==5)||(b==6))||serial!==((b==2)||(b==3)||(b==7))|| + ssc!==expect_ssc||orch!==expect_orch||fdp!==expect_fd||sdp!==expect_sd) + $fatal(1,"Routing layout=%h cts=%d scs=%d",layout,c,s); + routes=routes+1; + end + end + boot; + if(accepted[63]!==1'b1||accepted[54:43]!=={3'd2,3'd1,3'd3,3'd6}) + $fatal(1,"Initial all-zero configuration did not migrate"); + apply(64'd1); + repeat(10)begin tick;if(status_set)$fatal(1,"Premature initialization status request");end + apply(64'd0); + for(n=0;n<4;n=n+1)begin + next_request=64'h0000000000020148;next_request[13:12]=n; + apply(next_request); + if(!accepted[63]||accepted[13:12]!==((n+1)&3)|| + accepted[54:43]!=={3'd2,3'd1,3'd3,3'd6}|| + accepted[31:16]!==next_request[31:16])$fatal(1,"Legacy status migration"); + saved=accepted;repeat(10)tick; + if(accepted!==saved)$fatal(1,"Migration changed while host status stable"); + apply(saved); + if(accepted!==saved)$fatal(1,"Host acknowledgement was not idempotent"); + end + change(0,2); // Move floppy from slot4 into slot1, dropping that slot's legacy audio. + if(accepted[45:43]!==2||accepted[54:52]!==0)$fatal(1,"Singleton controller did not move"); + for(n=0;n<4;n=n+1)change(n,1); + if(accepted[54:43]!=={3'd1,3'd1,3'd1,3'd1})$fatal(1,"ROM slots are not independent"); + next_request=accepted;next_request[54:43]={3'd2,3'd1,3'd3,3'd6};apply(next_request); + change(2,4); // Moving SSC out of combined audio leaves Orchestra behind. + if(accepted[45:43]!==5||accepted[51:49]!==4||!accepted[42])$fatal(1,"SSC move/ownership split"); + change(1,5); + if(accepted[45:43]!==0||accepted[48:46]!==5)$fatal(1,"Orchestra singleton move"); + for(n=0;n<4;n=n+1)change(n,0); + if(accepted[54:43]!==0||accepted[42])$fatal(1,"Empty layout retains phantom device"); + boot; + for(n=0;n<4;n=n+1)begin + read_slot=n;repeat(2)tick;if(read_data!==8'hff)$fatal(1,"Empty socket not open bus"); + stream(n,65536,-1); + end + if(valid!==4'b1111||fault!==0)$fatal(1,"Four64K ROMs not loaded"); + for(n=0;n<4;n=n+1)for(j=0;j<4;j=j+1)verify_byte(n,j*16384+371,j*16384+371); + stream(0,131072,-1); // Capacity failure must not overwrite the other three ROMs. + if(valid!==4'b1110||!fault[0])$fatal(1,"Capacity failure was not isolated"); + for(n=1;n<4;n=n+1)verify_byte(n,32791,32791); + stream(0,8192,-1);verify_byte(0,7371,7371);verify_byte(0,7371+65536,7371); + stream(0,32,7); + if(valid[0]||!fault[0])$fatal(1,"Nonsequential transfer accepted"); + for(n=1;n<4;n=n+1)verify_byte(n,49167,49167); + boot;stream(0,131072,-1);stream(1,131072,-1); + if(valid!==4'b0011)$fatal(1,"Two128K ROMs not loaded"); + for(n=0;n<2;n=n+1)for(j=0;j<8;j=j+1)verify_byte(n,j*16384+813,j*16384+813); + stream(2,1,-1);if(!fault[2]||valid[2])$fatal(1,"Full pool did not refuse load"); + verify_byte(0,123879,123879);verify_byte(1,123879,123879); + enabled[1]=0;repeat(3)tick; + if(valid[1]||fault[1])$fatal(1,"Removed ROM retained occupancy/fault"); + stream(2,131072,-1);verify_byte(0,123879,123879);verify_byte(2,123879,123879); + enabled[2]=0;repeat(3)tick;stream(2,16,-1); + if(valid[2]||fault[2])$fatal(1,"Inactive remembered ROM was loaded"); + enabled=15; + // Removing a different socket on a failed transfer's completion edge must + // release both owners; otherwise the cleared owner's blocks leak forever. + boot;stream(0,131072,-1); + @(negedge clk);file_index=7;download=1;wr=1;address=1;data=0;tick; + @(negedge clk);download=0;wr=0;tick; + @(negedge clk);enabled[0]=0;tick;repeat(3)tick; + if(valid[0]||!fault[1])$fatal(1,"Concurrent removal/failure state"); + enabled=15;stream(2,131072,-1);stream(3,131072,-1); + if(valid!==4'b1100)$fatal(1,"Concurrent removal/failure leaked pool blocks"); + boot;stream(3,131073,-1); + if(valid[3]||!fault[3])$fatal(1,"Oversized ROM accepted"); + stream(3,128,-1);verify_byte(3,32779,11); + // Old index1 remains an alias for the third slot, without changing other stores. + @(negedge clk);file_index=1;download=1;wr=1;address=0;data=8'h5a;tick; + @(negedge clk);download=0;wr=0;repeat(3)tick; + read_slot=2;read_address=0;repeat(2)tick; + if(!valid[2]||read_data!==8'h5a)$fatal(1,"Legacy cartridge index alias"); + $display("PASS %0d routing combinations, migration/moves, four ROMs, banking, mirrors, capacity and malformed-load isolation",routes); + $finish; +end +initial begin #30000000;$fatal(1,"MPI test timeout");end +endmodule diff --git a/tests/boot_control_tb.sv b/tests/boot_control_tb.sv new file mode 100644 index 0000000..c4b1446 --- /dev/null +++ b/tests/boot_control_tb.sv @@ -0,0 +1,34 @@ +`timescale 1ns/1ps +module boot_control_tb; +reg clk=0,reset=1,display=0,cold=0; +always #5 clk=~clk; +wire actual_reset_n,actual_ee,reference_reset_n,reference_ee; +reg [1:0] delayed_display=0,delayed_cold=0; +always @(posedge clk or posedge reset) + if(reset) begin delayed_display<=0;delayed_cold<=0;end + else begin delayed_display<={delayed_display[0],display};delayed_cold<={delayed_cold[0],cold};end +EE_Cold_Bt dut(clk,reset,display,cold,actual_reset_n,actual_ee); +EE_Cold_Bt_reference reference(clk,reset,delayed_display[1],delayed_cold[1],reference_reset_n,reference_ee); +integer comparisons=0; +always @(negedge clk) if(!reset) begin + comparisons=comparisons+1; + if({actual_reset_n,actual_ee,dut.prog,dut.timer,dut.next_instruction}!== + {reference_reset_n,reference_ee,reference.prog,reference.timer,reference.next_instruction}) + $fatal(1,"boot-control program differs from upstream with two-stage input delay"); +end +initial begin + repeat(4) @(negedge clk);#1;reset=0; + #12;cold=1;#35;cold=0; + // Exercise actual full production cold-boot timer/program. + repeat(5500000) @(negedge clk); + #2;display=1;#37;display=0; + repeat(14000000) @(negedge clk); + #2;display=1;cold=1;#31;display=0;cold=0; + repeat(12) @(negedge clk);#2;reset=1; + repeat(4) @(negedge clk);#1;reset=0; + repeat(100) @(negedge clk); + $display("PASS %0d complete production boot-program comparisons: cold boot, Easter Egg, simultaneous priority and reset, with explicit two-stage input latency",comparisons); + $finish; +end +initial begin #200000000;$fatal(1,"boot control timeout");end +endmodule diff --git a/tests/bridge_protocol_tb.sv b/tests/bridge_protocol_tb.sv new file mode 100644 index 0000000..df89d06 --- /dev/null +++ b/tests/bridge_protocol_tb.sv @@ -0,0 +1,48 @@ +`timescale 1ns/1ps +module bridge_protocol_tb; +reg clk=0,fast=0,reset=1,request=0,read_cycle=1,memory_ack=0; +reg [24:0] address=0; +reg [7:0] data=0; +wire [24:0] captured_address; +wire [7:0] captured_data; +wire captured_read,memory_request,ack; +cpu_sdram_bridge dut(clk,fast,reset,address,data,request,read_cycle,memory_ack,ack,captured_address,captured_data,captured_read,memory_request); +always #10 clk=~clk; +always #5 fast=~fast; +task edge_wait; + begin @(negedge clk);#1;end +endtask +integer i; +reg [24:0] expected_address; +reg [7:0] expected_data; +reg expected_read; +initial begin + edge_wait();reset=0; + for(i=0;i<300;i=i+1) begin + // Previous acknowledgement may still be high when a new request arrives. + memory_ack=1;repeat(2) @(negedge fast); + @(posedge clk);#1; + request=1;address=$random;data=$random;read_cycle=i[0]; + expected_address=address;expected_data=data;expected_read=read_cycle; + repeat(3) begin edge_wait();if(ack!==0 || memory_request!==0) $fatal(1,"stale ACK accepted");end + memory_ack=0;edge_wait();edge_wait(); + if(memory_request!==1 || {captured_address,captured_data,captured_read}!=={expected_address,expected_data,expected_read}) $fatal(1,"request capture missing"); + address=~address;data=~data;read_cycle=~read_cycle; + repeat(i%7+1) begin + edge_wait(); + if({captured_address,captured_data,captured_read}!=={expected_address,expected_data,expected_read}) $fatal(1,"payload changed during wait"); + end + memory_ack=1;@(negedge fast);#1;if(ack!==1) $fatal(1,"fresh ACK missing"); + request=0;#1;if(ack!==0) $fatal(1,"ACK leaked after request drop"); + edge_wait();if(memory_request!==0) $fatal(1,"request did not drop"); + end + memory_ack=0;request=1;edge_wait();edge_wait(); + reset=1;edge_wait();if(memory_request!==0) $fatal(1,"reset did not abort request"); + repeat(3) begin edge_wait();if(memory_request!==0) $fatal(1,"request restarted during reset");end + request=0;reset=0;edge_wait();request=1;edge_wait(); + if(memory_request!==1) $fatal(1,"post-reset request failed"); + $display("PASS 300 request scoreboards: stale ACK rejection, fresh ACK, captured payload stability, arbitrary waits, reset abort/restart"); + $finish; +end +initial begin #1000000;$fatal(1,"bridge protocol timeout");end +endmodule diff --git a/tests/completion_phase_tb.sv b/tests/completion_phase_tb.sv new file mode 100644 index 0000000..6e03cf3 --- /dev/null +++ b/tests/completion_phase_tb.sv @@ -0,0 +1,32 @@ +`timescale 1ns/1ps +module completion_phase_tb; +reg sys=1,fast=1,clear=1,ready=0; +reg [15:0] data=0; +always #10 sys=~sys; +always #5 fast=~fast; +wire phase_ready; +wire [15:0] phase_data; +actual_completion dut(fast,clear,ready,data,phase_ready,phase_data); +integer comparisons=0,i; +reg observing=0; +// Compare the values the original and repaired CPU-side consuming edge sees, +// before the coincident positive-fast producer's NBA updates. +always @(negedge sys) if(observing && !clear) begin + if(phase_ready!==dut.data_ready) $fatal(1,"completion phase changed CPU-visible readiness"); + if(phase_ready && phase_data!==dut.hold_data) $fatal(1,"completion flag/data became incoherent"); + comparisons=comparisons+1; +end +initial begin + repeat(4) @(negedge sys);#1;clear=0;observing=1; + for(i=0;i<20000;i=i+1) begin + @(negedge fast);#1;data=$random;ready=$random; + if(i%19==0) clear=1; + if(i%19==3) clear=0; + end + clear=1;#1; + if(phase_ready!==0 || dut.data_ready!==0) $fatal(1,"completion clear missing"); + $display("PASS %0d original/repaired completion flag/data observations at actual CPU phase; no extra CPU sampling cycle, random producer traffic and clears",comparisons); + $finish; +end +initial begin #1000000;$fatal(1,"completion phase timeout");end +endmodule diff --git a/tests/cpu_sdram_bridge_tb.sv b/tests/cpu_sdram_bridge_tb.sv new file mode 100644 index 0000000..ad40ca2 --- /dev/null +++ b/tests/cpu_sdram_bridge_tb.sv @@ -0,0 +1,80 @@ +`timescale 1ns/1ps +module cpu_sdram_bridge_tb; +reg clk=1,fast=1,reset=1; +always #10 clk=~clk; +always #5 fast=~fast; +reg [24:0] address=0; +reg [7:0] data=0; +reg request=0,read_cycle=1; +wire [24:0] tx_address; +wire [7:0] tx_data; +wire tx_request,tx_read,ack,controller_ack,ready; +cpu_sdram_bridge dut(clk,fast,reset,address,data,request,read_cycle,controller_ack,ack,tx_address,tx_data,tx_read,tx_request); +wire [15:0] dq,dout; +wire [12:0] row; +wire [1:0] bank; +wire ras,cas,we; +// Constant read bus, not a physical SDRAM array/timing model. +assign dq=we?16'ha55a:16'hzzzz; +sdram_32r8w memory(.init(reset),.clk(fast),.SDRAM_DQ(dq),.SDRAM_A(row),.SDRAM_BA(bank), + .SDRAM_nRAS(ras),.SDRAM_nCAS(cas),.SDRAM_nWE(we),.sdram_dout(dout), + .sdram_cpu_addr(tx_address),.sdram_cpu_din(tx_data),.sdram_cpu_req(tx_request), + .sdram_cpu_rnw(tx_read),.sdram_cpu_ack(controller_ack),.sdram_cpu_ready(ready), + .sdram_vid_addr(25'd0),.sdram_vid_req(1'b0)); +reg [24:0] expected_address; +reg [7:0] expected_data; +reg expected_read,checking=0; +reg ready_seen=0; +reg [15:0] returned_data; +integer activations=0,commands=0,transactions=0; +always @(posedge fast) begin + #1; + if(checking) begin + if(ready) begin ready_seen=1;returned_data=dout;end + if({ras,cas,we}===3'b011) begin + if(row!==expected_address[22:10] || bank!==expected_address[24:23]) $fatal(1,"wrong row/bank payload"); + activations=activations+1; + end + if({ras,cas,we}===3'b101 || {ras,cas,we}===3'b100) begin + if(row[8:0]!==expected_address[9:1] || row[10:9]!==2'b10) $fatal(1,"wrong column/autoprecharge"); + if(row[12:11] !== (expected_read?2'b00:{~expected_address[0],expected_address[0]})) $fatal(1,"wrong byte mask"); + if((we===1)!==expected_read) $fatal(1,"wrong read/write command"); + if(!expected_read && dq!=={expected_data,expected_data}) $fatal(1,"wrong binary write data"); + commands=commands+1; + end + end +end +task transaction(input [24:0] a,input [7:0] d,input reg r); +integer count,old_commands,old_activations; +begin + @(posedge clk);#2; + expected_address=a;expected_data=d;expected_read=r; + old_commands=commands;old_activations=activations; + address=a;data=d;read_cycle=r;checking=1;request=1;ready_seen=0; + count=0; + while(ack!==1 && count<1000) begin @(negedge fast);#1;count=count+1;end + if(ack!==1) $fatal(1,"request acknowledgement timeout"); + // Once acknowledged, decode inputs may change; the transaction stays captured. + @(negedge clk);#1;request=0;address=~a;data=~d;read_cycle=~r; + count=0; + while(ready_seen!==1 && count<1000) begin @(negedge fast);#1;count=count+1;end + if(ready_seen!==1) $fatal(1,"transaction completion timeout"); + if(r && returned_data!==16'ha55a) $fatal(1,"read return data missing"); + repeat(5) @(negedge clk); + #2; + if(commands!=old_commands+1 || activations!=old_activations+1) $fatal(1,"lost/duplicate transaction"); + if(tx_request!==0 || ack!==0) $fatal(1,"request/ack did not clear"); + checking=0;transactions=transactions+1; +end +endtask +integer i; +initial begin + repeat(8) @(negedge clk);reset=0; + repeat(26000) @(negedge fast); // Complete >=200 us SDRAM initialization. + for(i=0;i<25;i=i+1) begin transaction(25'b1<>3)^(value>>7)); +endfunction +// WD native positive clock is the system negative edge in the full wrapper. +always @(negedge clk) if(enable && sampling) wd_pointer<=wd_pointer+1'b1; +always @(negedge clk) begin + if(!sampling) begin enable<=0;tick<=0;end + else begin + enable<=(tick==0);tick<=(tick>=period-1)?0:tick+1; + if(enable) begin + if(sdc_raw!==pattern(reads%512) || wd_raw!==pattern(reads%2048)) begin +`ifdef NEGATIVE_CONSECUTIVE + $fatal(1,"unsupported consecutive CPU disk read"); +`else + $fatal(1,"RAM pointer/read phase mismatch"); +`endif + end + if(sdc_piped!==sdc_raw || wd_piped!==wd_raw) $fatal(1,"CPU observed stale disk buffer: read=%0d Eperiod=%0d SDC=%h/%h WD=%h/%h ptr=%0d/%0d",reads,period,sdc_piped,sdc_raw,wd_piped,wd_raw,sdc_pointer,wd_pointer); + sdc_pointer<=sdc_pointer+1'b1;reads=reads+1; + end + end +end +integer i,profile; +initial begin + for(i=0;i<2048;i=i+1) begin + @(negedge clk);#1;write_address=i;write_data=pattern(i);writing=1; + // SDC is 512 bytes; write its independent expected low-address pattern. + sdc_writing=(i<512); + end + @(negedge clk);#1;writing=0;sdc_writing=0; + for(profile=0;profile<2;profile=profile+1) begin + @(negedge clk);#1;sampling=0;sdc_pointer=0;wd_pointer=0;reads=0; +`ifdef NEGATIVE_CONSECUTIVE + period=1; +`else + period=profile?6:2; +`endif + repeat(4) @(negedge clk);#1;sampling=1; + wait(reads>=2100);@(posedge clk);#1;sampling=0; + $display("PASS 2100 actual SDC/WD DPRAM CPU read comparisons, pointer phases, 512/2048-byte wrap; E period %0d",period); + end + $finish; +end +initial begin #1000000;$fatal(1,"disk buffer regression timeout");end +endmodule diff --git a/tests/external_audio_tb.sv b/tests/external_audio_tb.sv new file mode 100644 index 0000000..389f7a6 --- /dev/null +++ b/tests/external_audio_tb.sv @@ -0,0 +1,40 @@ +`timescale 1ns/1ps +// Real platform CE generator and I2S serializer, including the 48/96 kHz switch. +module external_audio_tb; + reg clk=0, reset=1, rate=0; + always #20.341 clk=~clk; + wire bclk,lrclk,data; + audio_pin_contract dut(clk,reset,rate,bclk,lrclk,data); + integer cycle=0, last_change=-10000, last_rise=-10000; + integer setup_min=10000, hold_min=10000, rises=0, changes=0; + reg checking=0; + always @(posedge clk) cycle=cycle+1; + always @(data or lrclk) if(checking) begin + if(cycle-last_rise < hold_min) hold_min=cycle-last_rise; + if(cycle-last_rise < 3) $fatal(1,"I2S receiver hold slot lost: %0d",cycle-last_rise); + last_change=cycle;changes=changes+1; + end + always @(posedge bclk) if(checking) begin + if(cycle-last_change < setup_min) setup_min=cycle-last_change; + if(cycle-last_change < 5) $fatal(1,"I2S receiver setup slot lost: %0d",cycle-last_change); + last_rise=cycle;rises=rises+1; + end + initial begin + dut.ce_phase.cnt=0; + dut.divider_phase.div=0; + repeat(10) @(negedge clk); + reset=0; + repeat(100) @(negedge clk); + checking=1; + repeat(30000) @(negedge clk); + rate=1; + repeat(30000) @(negedge clk); + rate=0; + repeat(30000) @(negedge clk); + checking=0; + if(rises<5000 || changes<1000 || setup_min!=5 || hold_min!=3) + $fatal(1,"Incomplete I2S transition coverage rises=%0d changes=%0d setup=%0d hold=%0d",rises,changes,setup_min,hold_min); + $display("PASS audio pin slots: %0d rises, %0d changes; setup >=%0d cycles, hold >=%0d cycles",rises,changes,setup_min,hold_min); + $finish; + end +endmodule diff --git a/tests/external_i2c_tb.sv b/tests/external_i2c_tb.sv new file mode 100644 index 0000000..cff633b --- /dev/null +++ b/tests/external_i2c_tb.sv @@ -0,0 +1,87 @@ +`timescale 1ns/1ps +module external_i2c_tb; + reg clk=0,start=0,rd=0; + reg slave_present=0,slave_release=1; + reg [7:0] slave_data=8'ha5; + always #10 clk=~clk; + tri1 scl,sda; + // Slave maximum 900 ns clock-to-data plus independent pin-edge extrema. + assign #(0,`SDA_FALL_NS,`SDA_RELEASE_NS) sda=slave_release ? 1'bz : 1'b0; + wire done,error; + wire [7:0] data; + i2c #(50_000_000,`BUS_HZ) dut(.CLK(clk),.START(start),.READ(rd),.I2C_ADDR(7'h20), + .I2C_WLEN(1'b1),.I2C_WDATA1(8'h96),.I2C_WDATA2(8'h5a), + .I2C_RDATA(data),.END(done),.ACK(error),.I2C_SCL(scl),.I2C_SDA(sda)); + realtime rise_time=0,fall_time=0,data_time=0,start_time=0,stop_time=0; + realtime minimum_low=1e9,minimum_high=1e9,minimum_setup=1e9; + integer rises=0,starts=0,stops=0,j,timeout; + integer bit_index=0,byte_index=0,checked_bytes=0; + reg [7:0] byte_value=0,expected_byte; + reg active=0,checking=0,first_fall=0; + always @(negedge scl) begin + if(slave_present && active) begin + if(bit_index==8 && (!rd || byte_index==0)) slave_release <= #900 0; + else if(rd && byte_index==1 && bit_index<8) slave_release <= #900 slave_data[7-bit_index]; + else slave_release <= #900 1; + end else slave_release <= #900 1; + end + always @(negedge sda) if(checking) begin + data_time=$realtime; + if(scl===1) begin + if(stop_time>0 && $realtime-stop_time<1300) $fatal(1,"I2C bus free below 1300ns"); + start_time=$realtime;starts=starts+1;active=1;first_fall=1; + bit_index=0;byte_index=0;byte_value=0; + end + end + always @(posedge sda) if(checking) begin + data_time=$realtime; + if(scl===1 && active) begin + if($realtime-rise_time<600) $fatal(1,"I2C stop setup below 600ns"); + stop_time=$realtime;stops=stops+1;active=0; + end + end + always @(negedge scl) if(checking && active) begin + if($realtime-rise_time0) begin + if(rise_time>0 && $realtime-rise_time<2500) $fatal(1,"I2C fast-mode period below 2500ns"); + if($realtime-fall_time=20);slave_data=j[1]?8'ha5:8'h5a;start=1; + repeat(3) @(negedge clk);start=0; + timeout=0; + while(!done && timeout<10000) begin @(negedge clk);timeout=timeout+1;end + if(timeout==10000) $fatal(1,"I2C completion timeout"); + if(error!==!slave_present || (rd && data!==(slave_present ? slave_data : 8'hff))) + $fatal(1,"I2C ACK/data behavior error=%b data=%h present=%b",error,data,slave_present); + repeat(500) @(negedge clk); + end + if(starts!=40 || stops!=40 || rises<600 || checked_bytes!=100) $fatal(1,"Incomplete I2C waveform coverage %0d/%0d/%0d/%0d",starts,stops,rises,checked_bytes); + $display("PASS I2C fast-mode slots: %0d rises, low=%0.3f high=%0.3f setup=%0.3f ns",rises,minimum_low,minimum_high,minimum_setup); + $finish; + end +endmodule diff --git a/tests/external_sdram_commands_tb.sv b/tests/external_sdram_commands_tb.sv new file mode 100644 index 0000000..87892e4 --- /dev/null +++ b/tests/external_sdram_commands_tb.sv @@ -0,0 +1,87 @@ +`timescale 1ns/1ps +// Pin-command minimum intervals, independent of the controller's state encoding. +module external_sdram_commands_tb; + reg clk=0,init=1,req=0,rnw=0; + always #4.365079 clk=~clk; + wire [15:0] dq; + assign dq=rnw ? 16'h965a : 16'hzzzz; + wire [12:0] address; + wire [1:0] bank; + wire cs,ras,cas,we,memclk,ack,ready; + reg [24:0] cpu_address=0; + integer commands=0,activates=0,writes=0,reads=0,refreshes=0; + realtime released=0, next_command=0; + realtime last_active[0:3],next_active[0:3]; + realtime now_time, earliest; + realtime last_refresh=-1; + reg configured=0; + integer b,j,timeout; + reg started=0; + sdram_probe dut(.init(init),.clk(clk),.SDRAM_DQ(dq),.SDRAM_A(address),.SDRAM_BA(bank), + .SDRAM_nCS(cs),.SDRAM_nRAS(ras),.SDRAM_nCAS(cas),.SDRAM_nWE(we),.SDRAM_CLK(memclk), + .sdram_cpu_addr(cpu_address),.sdram_cpu_din(8'h5a),.sdram_cpu_req(req),.sdram_cpu_rnw(rnw), + .sdram_cpu_ack(ack),.sdram_cpu_ready(ready),.sdram_vid_addr(25'd0),.sdram_vid_req(1'b0)); + initial for(b=0;b<4;b=b+1) begin last_active[b]=-1000000;next_active[b]=0;end + always @(posedge memclk) if(!init && {ras,cas,we}!==3'b111) begin + now_time=$realtime; + if(!started) begin + if(!$test$plusargs("IGNORE_STARTUP") && now_time-released<200000) + $fatal(1,"SDRAM startup below 200 us: %0.3f ns",now_time-released); + started=1; + end + if(now_time+0.001=0 && now_time-last_refresh>7812.5) $fatal(1,"SDRAM refresh interval above 7812.5 ns: %0.3f",now_time-last_refresh); + last_refresh=now_time; + end + end + 3'b000: begin next_command=now_time+14.0;configured=1;end + endcase + end + task transfer(input bit read_mode,input [24:0] addr); + begin + @(negedge clk);rnw=read_mode;cpu_address=addr;req=1; + timeout=0; + while(!ack && timeout<40000) begin @(negedge clk);timeout=timeout+1;end + if(timeout==40000) $fatal(1,"SDRAM request timeout"); + req=0; + while(ack) @(negedge clk); + if(read_mode) begin + timeout=0; + while(!ready && timeout<100) begin @(negedge clk);timeout=timeout+1;end + if(timeout==100) $fatal(1,"SDRAM read timeout"); + end + end + endtask + initial begin + repeat(10) @(negedge clk); + init=0;released=$realtime; + // Legal held-until-ACK requests may be queued during startup. + for(j=0;j<128;j=j+1) transfer(0,{9'd0,j[7:0],8'd0}); + for(j=0;j<32;j=j+1) transfer(1,{9'd0,j[7:0],8'd0}); + repeat(50000) @(negedge clk); + if(writes!=128 || reads!=32 || refreshes<3) $fatal(1,"Incomplete command coverage"); + $display("PASS SDRAM command intervals: startup >=200us, %0d ACT, %0d WR, %0d RD, %0d REF",activates,writes,reads,refreshes); + $finish; + end +endmodule diff --git a/tests/keyboard_control_phase_tb.sv b/tests/keyboard_control_phase_tb.sv new file mode 100644 index 0000000..e433ee5 --- /dev/null +++ b/tests/keyboard_control_phase_tb.sv @@ -0,0 +1,26 @@ +`timescale 1ns/1ps +module keyboard_control_phase_tb; +reg clk=0; +always #5 clk=~clk; +reg [3:0] controls=4'b1000,expected_controls=4'b1000; +reg [72:0] keys=0; +reg [7:0] columns=0; +wire observed,reference_value; +actual_keyboard_controls candidate(clk,controls,keys,columns,observed); +reference_keyboard_controls reference(expected_controls,keys,columns,reference_value); +integer flags,column,pattern,comparisons=0; +initial begin + for(flags=0;flags<16;flags=flags+1) + for(column=0;column<256;column=column+1) + for(pattern=0;pattern<256;pattern=pattern+1) begin + @(posedge clk);controls=flags;columns=column;keys[55:48]=pattern; + #1; + if(observed!==reference_value) $fatal(1,"Keyboard flags changed before sampling edge"); + @(negedge clk);#1;expected_controls=controls;#1; + if(observed!==reference_value) $fatal(1,"Keyboard row/control decode changed"); + comparisons=comparisons+1; + end + $display("PASS %0d exhaustive keyboard-row comparisons: all 16 EE/MUGS/shift controls, 256 column masks, 256 key patterns; original decode and one-negative-edge observation",comparisons); + $finish; +end +endmodule diff --git a/tests/peripheral_phase_tb.sv b/tests/peripheral_phase_tb.sv new file mode 100644 index 0000000..1ff1a37 --- /dev/null +++ b/tests/peripheral_phase_tb.sv @@ -0,0 +1,63 @@ +`timescale 1ns/1ps +module peripheral_phase_tb; +reg clk=0; +always #10 clk=~clk; +reg enable=0; +reg [8:0] address=0; +reg [7:0] data=0; +reg [15:0] palette=0; +reg selected=0; +reg ssc_palette_owner=1; +wire write_enable=enable && selected; +wire candidate_write_enable,supports_ssc; +actual_vdac_write qualification(enable,selected,ssc_palette_owner,candidate_write_enable,supports_ssc); +wire [7:0] old_q,new_q; +sdc_reference old_ram(.clock(clk),.address_a(9'd0),.data_a(8'd0),.wren_a(1'b0), + .address_b(address),.data_b(data),.wren_b(write_enable),.q_b(old_q)); +sdc_dpram new_ram(.clock(clk),.address_a(9'd0),.data_a(8'd0),.wren_a(1'b0), + .address_b(address),.data_b(data),.wren_b(write_enable),.q_b(new_q)); +reg [15:0] old_palette[0:255],new_palette[0:255]; +integer old_writes=0,new_writes=0; +always @(posedge clk) if(write_enable&&ssc_palette_owner) begin + old_palette[data]<=palette;old_writes=old_writes+1; +end +// Exact generated VDAC write-clock expression; generated wrapper supplies it. +wire candidate_write_clock; +actual_vdac_clock write_clock(clk,candidate_write_clock); +always @(posedge candidate_write_clock) if(candidate_write_enable) begin + new_palette[data]<=palette;new_writes=new_writes+1; +end +integer tick=0,cycles=0,i,seed=32'h451a46d0; +integer blocked_writes=0; +reg previous_enable=0; +// Model actual CPU contract: bus state changes at consuming negative edges; +// the producer chooses the *next* enable in the same NBA update. +always @(negedge clk) begin + if(enable) begin + address<=$random(seed);data<=$random(seed);palette<=$random(seed); + selected<=$random(seed); + end + previous_enable<=enable; + enable<=!enable && (($random(seed)&3)!=0); + cycles=cycles+1; +end +initial begin + for(i=0;i<512;i=i+1) begin old_ram.ram[i]=0;new_ram.ram[i]=0;end + for(i=0;i<256;i=i+1) begin old_palette[i]=0;new_palette[i]=0;end + repeat(20000) begin + @(negedge clk);#1; + if(cycles==10000&&supports_ssc)ssc_palette_owner=0; + if(cycles==15000)ssc_palette_owner=1; + if(!ssc_palette_owner&&write_enable)blocked_writes=blocked_writes+1; + if(old_writes!==new_writes) $fatal(1,"VDAC write count mismatch"); + for(i=0;i<512;i=i+1) + if(old_ram.ram[i]!==new_ram.ram[i]) $fatal(1,"SDC CPU write mismatch at %0d",i); + for(i=0;i<256;i=i+1) + if(old_palette[i]!==new_palette[i]) $fatal(1,"VDAC write payload mismatch at %0d",i); + end + if(new_writes<2000) $fatal(1,"Insufficient randomized writes"); + if(supports_ssc&&blocked_writes<500)$fatal(1,"Insufficient SSC palette write suppression"); + $display("PASS 20000 CPU bus intervals, %0d SDC/VDAC writes: old positive/new negative edge payload, address, enable and memory equality",new_writes); + $finish; +end +endmodule diff --git a/tests/reset_domains_tb.sv b/tests/reset_domains_tb.sv new file mode 100644 index 0000000..399df32 --- /dev/null +++ b/tests/reset_domains_tb.sv @@ -0,0 +1,36 @@ +`timescale 1ns/1ps +module reset_domains_tb; +reg clk_sys=0,CLK_114=0,run_sys=1,run_fast=1,RESET_RAW_N=1; +always #10 if(run_sys) clk_sys=~clk_sys; +always #5 if(run_fast) CLK_114=~CLK_114; +wire RESET_N,RESET_POS_N,RESET_FAST_N,WD_RESET_N; +actual_reset_domains dut(clk_sys,CLK_114,RESET_RAW_N,RESET_N,RESET_POS_N,RESET_FAST_N); +actual_wd_release disk(clk_sys,RESET_N,WD_RESET_N); +reg observing=0; +always @(posedge RESET_N) if(observing && clk_sys!==0) $fatal(1,"main reset released on wrong phase"); +always @(posedge RESET_POS_N) if(observing && clk_sys!==1) $fatal(1,"positive reset released on wrong phase"); +always @(posedge RESET_FAST_N) if(observing && CLK_114!==1) $fatal(1,"fast reset released on wrong phase"); +always @(posedge WD_RESET_N) if(observing && clk_sys!==1) $fatal(1,"disk reset released on wrong phase"); +integer phase; +initial begin + repeat(5) @(negedge clk_sys);observing=1; + for(phase=0;phase<7;phase=phase+1) begin + #(phase+1);RESET_RAW_N=0;#1; + if({RESET_N,RESET_POS_N,RESET_FAST_N,WD_RESET_N}!==0) $fatal(1,"asynchronous domain assertion missing"); + @(negedge clk_sys);run_sys=0;run_fast=0; + #13;RESET_RAW_N=1;#40; + if({RESET_N,RESET_POS_N,RESET_FAST_N,WD_RESET_N}!==0) $fatal(1,"stopped clocks released reset"); + run_sys=1; + @(negedge clk_sys);#1;if(RESET_N!==0) $fatal(1,"main released after only one edge"); + @(negedge clk_sys);#1;if(RESET_N!==1 || RESET_FAST_N!==0) $fatal(1,"main/fast release ordering wrong"); + @(posedge clk_sys);#1;if(WD_RESET_N!==0) $fatal(1,"disk released after one edge"); + @(posedge clk_sys);#1;if(WD_RESET_N!==1) $fatal(1,"disk release missing"); + run_fast=1; + @(posedge CLK_114);#1;if(RESET_FAST_N!==0) $fatal(1,"fast released after one edge"); + @(posedge CLK_114);#1;if(RESET_FAST_N!==1) $fatal(1,"fast release missing"); + end + $display("PASS actual domain and WD reset chains: seven phases, asynchronous assertion, two consuming edges, independently stopped clocks and release phases"); + $finish; +end +initial begin #10000;$fatal(1,"domain reset timeout");end +endmodule diff --git a/tests/ssc_mister_system_tb.sv b/tests/ssc_mister_system_tb.sv new file mode 100644 index 0000000..9818d60 --- /dev/null +++ b/tests/ssc_mister_system_tb.sv @@ -0,0 +1,92 @@ +`timescale 1ns/1ps +module ssc_mister_system_tb; +reg clk=0,pll_lock=0,cpu_ready=0,mode=1,commit=0,rnw=1; +wire power_reset; +actual_ssc_power_reset power_release(clk,pll_lock,power_reset); +always #5 clk=~clk; +reg [15:0] address=16'hff7e; +reg [7:0] data=0,index=0,file_data=0; +reg [24:0] file_address=0; +reg download=0,wr=0; +reg [11:0] mpi_layout={3'd2,3'd1,3'd3,3'd6}; +wire ready,fault,read_valid,palette_owner; +wire [7:0] read_data; +wire [15:0] left,right; +actual_ssc_mister_system dut(.clk_sys(clk),.SSC_POWER_RESET(power_reset),.RESET_POS_N(cpu_ready), + .SSC_MODE(mode),.MPI_LAYOUT(mpi_layout),.PH_2(commit),.RW_N(rnw),.ADDRESS(address),.DATA_OUT(data), + .ioctl_download(download),.ioctl_wr(wr),.ioctl_index({8'd0,index}),.ioctl_addr(file_address),.ioctl_data(file_data), + .SOUND_EN(1'b1),.SEL(2'd2),.ORCH_LEFT(8'd128),.ORCH_RIGHT(8'd128),.SOUND(8'd0), + .SSC_READY(ready),.SSC_FAULT(fault),.SOUND_LEFT(left),.SOUND_RIGHT(right), + .READ_VALID(read_valid),.READ_DATA(read_data),.PALETTE_OWNER(palette_owner)); +reg [7:0] pic[0:4095],voice[0:2047]; +string pic_path,voice_path; +integer fd,n,i,phi=0,commands=0,host_reads=0,audio_changes=0,previous_audio=0,voice_nonzero=0; +always @(posedge clk)if(!power_reset)begin + if(dut.ssc.phi_ce)begin + phi=phi+1;if(phi%50000==0)begin $display("PROGRESS actual MiSTer bindings phi=%0d commands=%0d",phi,commands);$fflush();end + end + if(fault)$fatal(1,"actual MiSTer binding cartridge fault PC=%04x",dut.ssc_debug_pc); + if(dut.ssc.command_read)host_reads=host_reads+1; + if(dut.ssc.speech_valid&&dut.ssc.speech_sample!=0)voice_nonzero=voice_nonzero+1; + if(dut.ssc_audio_valid)begin if(left!=previous_audio)audio_changes=audio_changes+1;previous_audio=left;end +end +task wait_phi(input integer ticks); +integer target; +begin target=phi+ticks;while(phi>63,1) + self.assertEqual((value>>12)&3,3) + self.assertEqual([(value>>(43+3*i))&7 for i in range(4)],[6,3,1,2]) + self.assertEqual(value^int.from_bytes(default_config(False),'little'),1<<42) + def test_changed_ssc_fails_before_creating_output(self): + with tempfile.TemporaryDirectory(dir=ROOT/'build') as folder: + base=Path(folder);roms=base/'roms';roms.mkdir() + for name in SSC: + original=(ROOT/'roms/ssc'/name).read_bytes() + (roms/name).write_bytes(original) + chip=roms/'pic-7040-510.bin';data=bytearray(chip.read_bytes());data[-1]^=1;chip.write_bytes(data) + out=base/'release' + with self.assertRaisesRegex(RuntimeError,'incorrect input'): + make_release(out,ROOT/'build/fpga',ROOT/'build/roms',roms) + self.assertFalse(out.exists()) + def test_corresponding_source_contains_no_local_roms(self): + release=ROOT/'dist/coco3plus' + with zipfile.ZipFile(release/'corresponding-source.zip') as archive: + names=archive.namelist();self.assertTrue(any(n.endswith('/rtl/coco3fpga.sv') for n in names)) + self.assertFalse(any('/roms/ssc/' in n or '/.deps/' in n or '/build/' in n for n in names)) + record=json.loads((release/'manifest.json').read_text()) + self.assertEqual(record['files']['config/coco3plus_v51.CFG']['policy'],'create-if-missing') +if __name__=='__main__':unittest.main() diff --git a/tests/test_tooling_guards.py b/tests/test_tooling_guards.py new file mode 100644 index 0000000..dcef5ee --- /dev/null +++ b/tests/test_tooling_guards.py @@ -0,0 +1,206 @@ +"""Exercise simulator-install and source-release boundaries without real ROMs. + +Copyright (c) 2026 Brian K. Holman. +Original test contributions: BSD-3-Clause; see LICENSES/. +""" +import hashlib +import io +import json +from pathlib import Path +import subprocess +import sys +import tarfile +import tempfile +import unittest +from unittest.mock import patch +import zipfile + +REPOSITORY = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(REPOSITORY / 'tools')) +import bootstrap +import release + + +def digest(path): + return hashlib.sha256(path.read_bytes()).hexdigest() + + +class SimulatorInstallGuards(unittest.TestCase): + def setUp(self): + self.temporary = tempfile.TemporaryDirectory(dir=REPOSITORY / 'build') + self.addCleanup(self.temporary.cleanup) + self.base = Path(self.temporary.name) + + def archive(self, *, include_runtime=True): + archive = self.base / 'simulator.tgz' + members = { + 'oss-cad-suite/bin/iverilog.exe': b'fake compiler fixture', + 'oss-cad-suite/share/readme.txt': b'fixture support data', + } + if include_runtime: + members['oss-cad-suite/bin/vvp.exe'] = b'fake runtime fixture' + with tarfile.open(archive, 'w:gz') as tar: + for name, data in members.items(): + entry = tarfile.TarInfo(name) + entry.size = len(data) + tar.addfile(entry, io.BytesIO(data)) + return archive, members + + def test_existing_incomplete_install_is_preserved_and_rejected(self): + archive, _ = self.archive() + folder = self.base / 'installed' + folder.mkdir() + sentinel = folder / 'partial-user-file' + sentinel.write_bytes(b'preserve prior incomplete evidence') + + with self.assertRaisesRegex(RuntimeError, 'Incomplete/legacy simulator'): + bootstrap.install_simulator(archive, folder, digest(archive)) + + self.assertEqual(sentinel.read_bytes(), b'preserve prior incomplete evidence') + self.assertEqual(list(folder.iterdir()), [sentinel]) + self.assertFalse(folder.with_name('installed.partial').exists()) + + def test_complete_extraction_is_published_then_corruption_is_rejected(self): + archive, members = self.archive() + folder = self.base / 'installed' + archive_hash = digest(archive) + + bootstrap.install_simulator(archive, folder, archive_hash) + + self.assertTrue(folder.is_dir()) + self.assertFalse(folder.with_name('installed.partial').exists()) + marker = json.loads((folder / '.coco3plus-install.json').read_text()) + self.assertEqual(marker['archive_sha256'], archive_hash) + self.assertEqual(set(marker['files']), set(members)) + for name, data in members.items(): + self.assertEqual((folder / name).read_bytes(), data) + self.assertEqual(marker['files'][name]['sha256'], digest(folder / name)) + + # A healthy rerun verifies the installed tree. A same-length mutation + # must also be rejected; checking existence or length alone is inadequate. + bootstrap.install_simulator(archive, folder, archive_hash) + executable = folder / 'oss-cad-suite/bin/vvp.exe' + mutated = bytearray(executable.read_bytes()) + mutated[-1] ^= 1 + executable.write_bytes(mutated) + + with self.assertRaisesRegex(RuntimeError, 'installation incomplete/changed'): + bootstrap.install_simulator(archive, folder, archive_hash) + self.assertEqual(executable.read_bytes(), bytes(mutated)) + + def test_failed_extraction_never_publishes_a_complete_directory(self): + archive, _ = self.archive(include_runtime=False) + folder = self.base / 'installed' + + with self.assertRaisesRegex(RuntimeError, 'Missing simulator executable'): + bootstrap.install_simulator(archive, folder, digest(archive)) + + self.assertFalse(folder.exists()) + partial = folder.with_name('installed.partial') + self.assertTrue(partial.is_dir()) + self.assertFalse((partial / '.coco3plus-install.json').exists()) + + +class PublicSourceReleaseGuards(unittest.TestCase): + def setUp(self): + self.temporary = tempfile.TemporaryDirectory(dir=REPOSITORY / 'build') + self.addCleanup(self.temporary.cleanup) + self.root = Path(self.temporary.name) / 'repository' + self.root.mkdir() + self.hooks = Path(self.temporary.name) / 'empty-hooks' + self.hooks.mkdir() + files = { + '.gitignore': b'/build/\n/dist/\n', + '.gitattributes': b'* -text\n', + 'NOTICE.md': b'Fixture notice only.\n', + 'LICENSING.md': b'Fixture component terms.\n', + 'COPYRIGHT.md': b'Fixture attribution.\n', + 'LICENSES/Fixture.txt': b'Fixture license text.\n', + 'rtl/ssc/LICENSE': b'Fixture SSC notice only; no ROM contents.\n', + 'rtl/example.sv': b'module example; endmodule\n', + } + for name, data in files.items(): + path = self.root / name + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(data) + self.git('init', '--quiet') + self.git('add', '--', *files) + self.git('-c', 'user.name=Tooling Test', + '-c', 'user.email=tooling-test@example.invalid', + '-c', 'commit.gpgsign=false', + 'commit', '--quiet', '-m', 'Create isolated fixture') + self.tracked = set(files) + self.revision = self.git('rev-parse', 'HEAD').decode().strip() + + self.build = self.root / 'build/fpga' + rbf = self.build / 'project/output_files/CoCo3.rbf' + rbf.parent.mkdir(parents=True) + rbf.write_bytes(b'FAKE RBF FOR RELEASE TEST ONLY') + record = { + 'passed': True, + 'rbf_bytes': rbf.stat().st_size, + 'rbf_sha256': digest(rbf), + 'inputs': {'rtl/example.sv': digest(self.root / 'rtl/example.sv')}, + } + (self.build / 'build.json').write_text(json.dumps(record)) + self.output = self.root / 'dist/public-release' + self.root_patch = patch.object(release, 'ROOT', self.root) + self.root_patch.start() + self.addCleanup(self.root_patch.stop) + + def git(self, *arguments): + return subprocess.check_output( + ['git', '-c', 'core.autocrlf=false', + '-c', 'core.hooksPath=' + str(self.hooks), *arguments], + cwd=self.root, stderr=subprocess.STDOUT) + + def package(self): + # Neither input directory exists. Public packaging must not read ROMs. + return release.make_release( + self.output, self.build, self.root / 'missing-boot-roms', + self.root / 'missing-ssc-roms', public=True) + + def test_untracked_private_files_do_not_enter_public_release(self): + (self.root / '.env').write_text('fixture-private-value=not-for-export\n') + (self.root / 'private-notes.txt').write_text('private fixture notes\n') + untracked = self.git('ls-files', '--others', '--exclude-standard').decode() + self.assertIn('.env', untracked) + self.assertIn('private-notes.txt', untracked) + + record = self.package() + + self.assertTrue(record['public_package']) + self.assertFalse(record['ssc_included']) + self.assertTrue(record['roms_required_separately']) + self.assertEqual(record['source_revision'], self.revision) + fat_files = {p.relative_to(self.output / 'fat').as_posix() + for p in (self.output / 'fat').rglob('*') if p.is_file()} + self.assertFalse(any(Path(n).suffix.lower() in ('.rom', '.bin', '.ccc') + for n in fat_files)) + self.assertIn('_Computer/.coco3plus/' + + record['rbf_sha256'][:12] + '/coco3plus.rbf', fat_files) + self.assertEqual(set(record['files']), fat_files) + with zipfile.ZipFile(self.output / 'corresponding-source.zip') as archive: + source_files = {n for n in archive.namelist() if not n.endswith('/')} + self.assertEqual(source_files, + {'coco3plus/' + n for n in self.tracked}) + self.assertFalse(any('.env' in n or 'private-notes' in n + for n in source_files)) + with zipfile.ZipFile(self.output.with_name('public-release.zip')) as archive: + self.assertNotIn('.env', archive.namelist()) + self.assertNotIn('private-notes.txt', archive.namelist()) + + def test_dirty_tracked_source_rejects_before_output_creation(self): + notice = self.root / 'NOTICE.md' + notice.write_bytes(notice.read_bytes() + b'Unreviewed tracked change.\n') + self.assertTrue(self.git('status', '--porcelain', '--untracked-files=no')) + + with self.assertRaisesRegex(RuntimeError, 'Commit reviewed changes'): + self.package() + + self.assertFalse(self.output.exists()) + self.assertFalse(self.output.with_name('public-release.zip').exists()) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/video_sdram_tb.sv b/tests/video_sdram_tb.sv new file mode 100644 index 0000000..e90eeb5 --- /dev/null +++ b/tests/video_sdram_tb.sv @@ -0,0 +1,198 @@ +`timescale 1ns/1ps +// Logical SDRAM command/data model. Not an electrical SDRAM timing model. +module video_read_model #(parameter RETURN_DELAY_NS=0, COMMAND_DELAY_NS=0)(input clk, input [2:0] command, + input [12:0] address, input [1:0] bank, inout [15:0] dq, + output integer reads=0, output integer refreshes=0); +reg [12:0] rows[0:3]; +reg [15:0] pipe[0:3]; +reg [3:0] valid=0; +reg [15:0] drive=16'hzzzz; +reg [23:0] word_address; +integer i; +wire [2:0] pin_command; +wire [12:0] pin_address; +wire [1:0] pin_bank; +assign #(COMMAND_DELAY_NS) pin_command=command; +assign #(COMMAND_DELAY_NS) pin_address=address; +assign #(COMMAND_DELAY_NS) pin_bank=bank; +assign dq=drive; +function [15:0] contents(input [23:0] a); + contents=a[15:0] ^ {a[23:16],a[23:16]} ^ 16'h96a5; +endfunction +always @(negedge clk) begin + drive <= #(RETURN_DELAY_NS) (valid[0]?pipe[0]:16'hzzzz); + for(i=0;i<3;i=i+1) pipe[i]=pipe[i+1]; + valid=valid>>1; + if(pin_command===3'b011) rows[pin_bank]=pin_address; + if(pin_command===3'b001) refreshes=refreshes+1; + if(pin_command===3'b101) begin + word_address={pin_bank,rows[pin_bank],pin_address[8:0]}; + // Sequential burst length two wraps within the aligned pair. + pipe[2]=contents(word_address);pipe[3]=contents(word_address ^ 24'd1); + valid[2]=1;valid[3]=1;reads=reads+1; + end +end +endmodule + +module video_channel #(parameter CANDIDATE=0)( + input clk,reset,hborder, input [24:0] base, + input [6:0] offset, input coco1, input [3:0] hres, + input wide,contention, output [8:0] buffer_address, + output [15:0] buffer_data, output buffer_write, + output [4:0] fetch_state, output integer cpu_reads=0, + output integer memory_reads,refreshes); +wire [24:0] vid_address; +wire request,ack,ready; +wire [15:0] dout,dq; +wire [12:0] row; +wire [1:0] bank; +wire ras,cas,we,cpu_ack,cpu_ready; +reg cpu_request=0; +integer phase=0; +// Independent competing CPU requests; each held until acknowledgement. +always @(posedge clk) begin + if(reset) begin cpu_request<=0;phase<=0;end + else begin + phase<=phase+1; + if(cpu_ack) cpu_request<=0; + else if(contention && phase%23==0) cpu_request<=1; + if(cpu_ready) cpu_reads<=cpu_reads+1; + end +end +coco_mem_fetch fetch(.fast_clk(clk),.RESET_N(!reset), + .SDRAM_VID_REQ(request),.SDRAM_VID_ADDR(vid_address), + .SDRAM_VID_ACK(ack),.SDRAM_VID_READY(ready),.SDRAM_DOUT(dout), + .BUFF_ADD(buffer_address),.BUFF_DATA_O(buffer_data),.BUFFER_WRITE(buffer_write), + .RAM_ADDRESS(base),.HBORDER(hborder),.HOR_OFFSET(offset), + .COCO1(coco1),.HRES(hres),.CT_320_160(wide)); +assign fetch_state=fetch.state; +generate if(CANDIDATE) begin + sdram_candidate memory(.init(reset),.clk(clk),.SDRAM_DQ(dq),.SDRAM_A(row), + .SDRAM_BA(bank),.SDRAM_nRAS(ras),.SDRAM_nCAS(cas),.SDRAM_nWE(we), + .sdram_dout(dout),.sdram_cpu_addr(25'h1023456),.sdram_cpu_din(8'd0), + .sdram_cpu_req(cpu_request),.sdram_cpu_rnw(1'b1),.sdram_cpu_ack(cpu_ack), + .sdram_cpu_ready(cpu_ready),.sdram_vid_addr(vid_address),.sdram_vid_req(request), + .sdram_vid_ack(ack),.sdram_vid_ready(ready)); +end else begin + sdram_reference memory(.init(reset),.clk(clk),.SDRAM_DQ(dq),.SDRAM_A(row), + .SDRAM_BA(bank),.SDRAM_nRAS(ras),.SDRAM_nCAS(cas),.SDRAM_nWE(we), + .sdram_dout(dout),.sdram_cpu_addr(25'h1023456),.sdram_cpu_din(8'd0), + .sdram_cpu_req(cpu_request),.sdram_cpu_rnw(1'b1),.sdram_cpu_ack(cpu_ack), + .sdram_cpu_ready(cpu_ready),.sdram_vid_addr(vid_address),.sdram_vid_req(request), + .sdram_vid_ack(ack),.sdram_vid_ready(ready)); +end endgenerate +`ifndef REFERENCE_RETURN_DELAY + `define REFERENCE_RETURN_DELAY 0 +`endif +`ifndef CANDIDATE_RETURN_DELAY + `define CANDIDATE_RETURN_DELAY 0 +`endif +// The functional comparison tests the payload/handshake at the declared return +// latency. Physical min/max windows are checked separately by external-I/O STA. +video_read_model #(.RETURN_DELAY_NS(CANDIDATE ? `CANDIDATE_RETURN_DELAY : `REFERENCE_RETURN_DELAY)) model(clk,{ras,cas,we},row,bank,dq,memory_reads,refreshes); +endmodule + +module video_sdram_tb; +reg clk=0,reset=1,hborder=0; +always #5 clk=~clk; +reg [24:0] base=0; +reg [6:0] offset=0; +reg coco1=0,wide=1,contention=0; +reg [3:0] hres=0; +wire [8:0] address[0:1]; +wire [15:0] data[0:1]; +wire [1:0] write_buffer; +wire [4:0] state[0:1]; +wire [31:0] cpu_reads[0:1],memory_reads[0:1],refreshes[0:1]; +genvar g; +generate for(g=0;g<2;g=g+1) begin + video_channel #(.CANDIDATE(g)) channel(clk,reset,hborder,base,offset,coco1,hres, + wide,contention,address[g],data[g],write_buffer[g],state[g], + cpu_reads[g],memory_reads[g],refreshes[g]); +end endgenerate +reg checking=0; +integer count[0:1]; +reg [15:0] reference_data[0:511],candidate_data[0:511]; +integer k,limit,scenario=0,total_words=0; +reg [8:0] word_offset; +reg [24:0] expected_byte; +reg [23:0] expected_word; +reg [15:0] expected_data; +integer beat_index; +always @(posedge clk) begin + if(checking) for(k=0;k<2;k=k+1) if(write_buffer[k]) begin + if(address[k]!==count[k]) $fatal(1,"buffer index channel=%0d scenario=%0d count=%0d actual=%h",k,scenario,count[k],address[k]); + if(count[k]>=512) $fatal(1,"buffer overrun"); + if(k==0) reference_data[count[k]]=data[k];else candidate_data[count[k]]=data[k]; + // Check the visible line against an address-derived oracle, independent of + // the DUT FSM. Extra upstream guard words are compared separately below. + if(count[k]>16):raise RuntimeError('Archive symlink') + target=folder/rel + if m.is_dir():target.mkdir(parents=True,exist_ok=True) + else:target.parent.mkdir(parents=True,exist_ok=True);target.write_bytes(z.read(m)) + found=list(folder.rglob('lwasm.exe')) + if len(found)!=1 or sha(found[0])!=item['lwasm_sha256']:raise RuntimeError('Pinned LWASM not found or changed') + print('LWASM '+str(found[0])) + if 'cocoroms' in a.only: + item=json.loads((ROOT/'tools/cocoroms.json').read_text()) + folder=ROOT/'.deps/cocoroms';folder.mkdir(parents=True,exist_ok=True) + for name,value in item['upstreamFileSHA256'].items(): + url=f"https://raw.githubusercontent.com/nitros9project/toolshed/{item['sourceRevision']}/cocoroms/{name}" + cached=fetch(url,a.cache/('cocoroms-'+item['sourceRevision'])/name,value) + target=folder/name + if target.exists() and sha(target)!=value:raise RuntimeError('Prepared assembly changed: '+name) + if not target.exists():shutil.copyfile(cached,target) + print('ToolShed assembly: eight source files verified; no prebuilt ROM input') + if 'main' in a.only: + item=lock['main_reference'];folder=ROOT/'.deps/main';folder.mkdir(parents=True,exist_ok=True) + for name,record in item['files'].items(): + cached=fetch(f"https://raw.githubusercontent.com/MiSTer-devel/Main_MiSTer/{item['revision']}/{name}",a.cache/('main-'+item['revision'])/name,record['sha256']) + target=folder/name + if target.exists() and sha(target)!=record['sha256']:raise RuntimeError('Main reference changed: '+name) + if not target.exists():shutil.copyfile(cached,target) + (folder/'provenance.json').write_text(json.dumps(item,indent=2)+'\n') + print('Main parser reference verified (not installed or modified)') + if 'simulator' in a.only: + item=lock['oss_cad_windows'];archive=fetch(item['url'],a.cache/item['archive'],item['sha256']) + folder=a.simulator_dir.resolve() + install_simulator(archive,folder,item['sha256']) + print('Simulator '+str(folder/'oss-cad-suite')) +if __name__=='__main__':main() diff --git a/tools/build_fpga.py b/tools/build_fpga.py new file mode 100644 index 0000000..0d50d62 --- /dev/null +++ b/tools/build_fpga.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +"""Build in a fresh source copy using pinned Quartus; leave source/IP untouched.""" +import argparse, datetime, hashlib, json, re, shutil, subprocess +from pathlib import Path,PurePosixPath +ROOT=Path(__file__).resolve().parents[1] +def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest() +def main(): + p=argparse.ArgumentParser(description=__doc__) + p.add_argument('--quartus',type=Path,required=True,help='Full path to quartus_sh.exe (17.0.2 Build602)') + p.add_argument('--output',type=Path,default=ROOT/'build/fpga') + p.add_argument('--prepare-only',action='store_true') + a=p.parse_args();a.output=a.output.resolve() + if not a.output.is_relative_to(ROOT/'build') or a.output.exists():raise RuntimeError('Use a fresh repository build/ directory') + version=subprocess.check_output([str(a.quartus.resolve()),'--version'],stderr=subprocess.STDOUT).decode() + if not re.search(r'17\.0\.2\s+Build\s+602',version):raise RuntimeError('Expected Quartus17.0.2 Build602: '+version) + inventory=json.loads((ROOT/'tools/project_inputs.json').read_text()) + names=inventory['files'] + if len(names)!=len(set(names)):raise RuntimeError('Duplicate project input') + for name in names: + relative=PurePosixPath(name) + if relative.is_absolute() or '..' in relative.parts or '\\' in name or ':' in name:raise RuntimeError('Unsafe project input: '+name) + if not (ROOT/name).is_file() or (ROOT/name).is_symlink():raise RuntimeError('Missing/nonregular project input: '+name) + # New HDL/IP/constraint files must not silently disappear from the build copy. + extensions={'.sv','.v','.vh','.vhd','.qip','.sdc','.mif','.hex','.qsys','.ip','.tcl'} + candidates=[p for folder in (ROOT/'rtl',ROOT/'sys') for p in folder.rglob('*') if p.is_file() and p.suffix.lower() in extensions] + candidates += [p for p in ROOT.iterdir() if p.is_file() and p.suffix.lower() in extensions] + missing=sorted(p.relative_to(ROOT).as_posix() for p in candidates if p.relative_to(ROOT).as_posix() not in names) + if missing:raise RuntimeError('Add new project dependencies to tools/project_inputs.json: '+', '.join(missing)) + seeds=re.findall(r'^set_global_assignment\s+-name\s+SEED\s+(\d+)\s*$',(ROOT/'CoCo3.qsf').read_text(),re.M) + if len(seeds)!=1:raise RuntimeError('Require one literal SEED assignment in CoCo3.qsf') + seed=int(seeds[0]) + project=a.output/'project';project.mkdir(parents=True) + inputs={} + for name in names: + source=ROOT/name;target=project/name;target.parent.mkdir(parents=True,exist_ok=True) + shutil.copyfile(source,target) + if name not in ('README.md','.gitignore','changes.txt'):inputs[name]=sha(source) + # The unchanged upstream flow generates build_id.v in this copy only. + receipt=dict(source_commit_at_build=subprocess.check_output(['git','rev-parse','HEAD'],cwd=ROOT).decode().strip(),source_state='Working tree with individually hashed project inputs',quartus=version.strip(),seed=seed,project_inventory_sha256=sha(ROOT/'tools/project_inputs.json'),inputs=inputs,prepared_utc=datetime.datetime.now(datetime.timezone.utc).isoformat(),scope='Prepared source only') + (a.output/'build.json').write_text(json.dumps(receipt,indent=2)+'\n') + if a.prepare_only:print('Prepared '+str(project));return + command=[str(a.quartus.resolve()),'--flow','compile','CoCo3'] + with (a.output/'compile.log').open('w') as log: + result=subprocess.run(command,cwd=project,stdout=log,stderr=subprocess.STDOUT) + receipt['command']=['quartus_sh','--flow','compile','CoCo3'];receipt['exit_code']=result.returncode + rbf=project/'output_files/CoCo3.rbf' + if result.returncode or not rbf.exists():raise RuntimeError('Compilation failed; inspect '+str(a.output/'compile.log')) + summary=project/'output_files/CoCo3.sta.summary' + text=summary.read_text(errors='replace') + slack=[float(x) for x in re.findall(r'Slack\s*:\s*([-+\d.]+)',text,re.I)] + if not slack or min(slack)<0:raise RuntimeError('Missing or negative timing summary; inspect '+str(summary)) + if any(sha(ROOT/n)!=h for n,h in inputs.items()):raise RuntimeError('Source changed during compilation') + receipt.update(scope='Full native fit and timing summary; detailed path audits and hardware are separate',rbf_sha256=sha(rbf),rbf_bytes=rbf.stat().st_size,summary_sha256=sha(summary),slack_ns=slack,passed=True) + (a.output/'build.json').write_text(json.dumps(receipt,indent=2)+'\n');print(json.dumps({k:v for k,v in receipt.items() if k!='inputs'},indent=2)) +if __name__=='__main__':main() diff --git a/tools/build_roms.py b/tools/build_roms.py new file mode 100644 index 0000000..0deb501 --- /dev/null +++ b/tools/build_roms.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +"""Assemble ToolShed CoCo firmware with native LWASM; no make, WSL or binary inputs.""" +import argparse, hashlib, json, shutil, subprocess +from pathlib import Path +ROOT=Path(__file__).resolve().parents[1] +def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest() +def main(): + p=argparse.ArgumentParser(description=__doc__) + p.add_argument('--source',type=Path,default=ROOT/'.deps/cocoroms') + p.add_argument('--lwasm',type=Path) + p.add_argument('--output',type=Path,default=ROOT/'build/roms') + a=p.parse_args();meta=json.loads((ROOT/'tools/cocoroms.json').read_text()) + if a.output.exists():raise RuntimeError('Use a fresh output directory') + for name,h in meta['upstreamFileSHA256'].items(): + if sha(a.source/name)!=h:raise RuntimeError('Assembly source mismatch: '+name) + if a.lwasm is None: + found=list((ROOT/'.tools/lwtools').rglob('lwasm.exe')) + if len(found)!=1:raise RuntimeError('Run bootstrap.py or supply --lwasm') + a.lwasm=found[0] + a.lwasm=a.lwasm.resolve();a.output.mkdir(parents=True) + work=a.output/'work';shutil.copytree(a.source,work) + if any(p.suffix.lower() in ('.bin','.rom') for p in work.rglob('*')):raise RuntimeError('Unexpected binary firmware input') + commands=[] + def run(args,stdout=None): + commands.append(args) + result=subprocess.run([str(a.lwasm),*args],cwd=work,capture_output=True,check=True) + if stdout:(work/stdout).write_bytes(result.stdout) + with (a.output/'build.log').open('ab') as log:log.write(result.stderr) + run(['--raw','-o','bas13.rom','equates.asm','bas.asm']) + run(['--symbol-dump','--no-output','equates.asm','bas.asm'],'cb_equates.asm') + run(['--raw','-o','extbas11.rom','cb_equates.asm','extbas.asm']) + run(['--symbol-dump','--no-output','equates.asm','bas.asm','extbas.asm'],'ecb_equates.asm') + run(['--raw','--pragma=noindex0tonone','-o','disk11.rom','ecb_equates.asm','disk.asm']) + run(['--raw','-o','coco3.rom','equates.asm','coco3.asm']) + outputs={} + for name,expected in meta['romOutputs'].items(): + actual={'bytes':(work/name).stat().st_size,'sha256':sha(work/name)} + if actual!=expected:raise RuntimeError('Assembled ROM mismatch: '+name) + shutil.copyfile(work/name,a.output/name);outputs[name]=actual + for source,target in [('coco3.rom','boot0.rom'),('disk11.rom','boot1.rom')]:shutil.copyfile(a.output/source,a.output/target) + notice='Rebuilt from ToolShed cocoroms assembly at '+meta['sourceRevision']+'.\nOriginal Tandy/Microsoft/Microware notices remain applicable.\nNo preassembled firmware input. SSC chip ROMs are separate external inputs.\n' + (a.output/'ROM_SOURCE_NOTICE.txt').write_text(notice) + (a.output/'manifest.json').write_text(json.dumps(dict(source_url=meta['sourceURL'],source_revision=meta['sourceRevision'],source_sha256=meta['upstreamFileSHA256'],assembler_sha256=sha(a.lwasm),assembler_version=subprocess.check_output([str(a.lwasm),'--version']).decode().strip(),commands=commands,roms=outputs,preassembled_inputs=False),indent=2)+'\n') + print('PASS: all four reconstructed ROM hashes; boot0/boot1 staged') +if __name__=='__main__':main() diff --git a/tools/cocoroms.json b/tools/cocoroms.json new file mode 100644 index 0000000..8c7ad99 --- /dev/null +++ b/tools/cocoroms.json @@ -0,0 +1,33 @@ +{ + "sourceURL": "https://github.com/nitros9project/toolshed", + "sourceRevision": "3667a41c9605b7fcb150eace29cc7f42d460be1a", + "upstreamFileSHA256": { + "Makefile": "4a29262fc1ba0b6106887425f5b0a4edb8ab81fd343af548cb3a863bda3aea51", + "bas.asm": "ca2e0fba27a1c960f56648ab7be6571a89a4aff6c433b9a2649924e308e8bf24", + "coco3.asm": "01147f426baf1b48fc6d590f18ca5974bedc3dfac486020e694d9f4b890d74f2", + "disk.asm": "735443637ebaddc358f6a12856c495cc92e08f3aaa8bb68cf9a0494d7655faae", + "equates.asm": "099d4ae145ee5151aa1eb7e9805388d338b2613fd53e2ba666ab757734d94442", + "extbas.asm": "75ce20734d0272f636a961b318fb898c555061194da12d9bfc26782fc4b5e42b", + "md5sums.txt": "f0374ad4bdd32f9cd322cfa5eafe04a0b27d2e90698b536aa26c00d1ea7c8eab", + "mugateerspic.asm": "2878b1a9fbf7cc3bde25475f5e256f25910fdb44b1b2f8e6f01883bcf13548a1" + }, + "romOutputs": { + "bas13.rom": { + "bytes": 8192, + "sha256": "5375b1caef9df815b781d9cd6df81ecdaddd2642b06a01adac521e40f1329751" + }, + "coco3.rom": { + "bytes": 32768, + "sha256": "ad358430568250eb8330a37f85361d9ce67e5ae6d5a28c17b31802cd3953a5d2" + }, + "disk11.rom": { + "bytes": 8192, + "sha256": "1c40c5a74e72edaeecc2511fee1aab347eae2c3d5fc6778cb622e3df14d63157" + }, + "extbas11.rom": { + "bytes": 8192, + "sha256": "a18f270d3495d82b9f515de049f46253a623a2d9b1bb226c9ad338508344c5ee" + } + }, + "license": "File-specific Tandy, Microsoft and Microware notices retained in reconstructed firmware and assembly comments." +} diff --git a/tools/install_mister.py b/tools/install_mister.py new file mode 100644 index 0000000..b435278 --- /dev/null +++ b/tools/install_mister.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +"""Install a verified overlay using existing passwordless OpenSSH access.""" +import argparse,datetime,json,re,shlex,subprocess +from pathlib import Path,PurePosixPath +from release import ROOT,make_release,sha +def q(s):return shlex.quote(str(s)) +def main(): + p=argparse.ArgumentParser(description=__doc__) + p.add_argument('--host',help='IP or DNS hostname; prompted when omitted') + p.add_argument('--user',default='root') + p.add_argument('--release',type=Path,help='Existing tools/release.py output; otherwise package defaults') + p.add_argument('--without-ssc',action='store_true') + p.add_argument('--load',action='store_true',help='Return to MENU then load the new launcher') + a=p.parse_args();a.host=a.host or input('MiSTer IP address or hostname: ').strip() + if not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9._-]*',a.host) or not re.fullmatch(r'[A-Za-z_][A-Za-z0-9_-]*',a.user):p.error('Use a plain hostname/IP and Unix username') + stamp=datetime.datetime.now(datetime.timezone.utc).strftime('%Y%m%dT%H%M%S%fZ') + release=a.release.resolve() if a.release else ROOT/'dist'/('install-'+stamp) + if not a.release:make_release(release,ROOT/'build/fpga',ROOT/'build/roms',ROOT/'roms/ssc',a.without_ssc) + manifest=json.loads((release/'manifest.json').read_text());fat=release/'fat' + if manifest.get('public_package'):raise RuntimeError('Public core/source package omits required ROMs. Build a complete local package with your verified ROM inputs; see docs/INSTALL.md.') + for n,v in manifest['files'].items(): + path=PurePosixPath(n) + if path.is_absolute() or '..' in path.parts or '\\' in n:raise RuntimeError('Unsafe manifest path') + file=fat/n + if not file.is_file() or file.stat().st_size!=v['bytes'] or sha(file)!=v['sha256']:raise RuntimeError('Release changed: '+n) + args=['-o','BatchMode=yes','-o','StrictHostKeyChecking=yes','-o','ConnectTimeout=10'] + target=a.user+'@'+a.host + def ssh(script):return subprocess.check_output(['ssh',*args,target,'sh -s'],input=script.encode(),stderr=subprocess.STDOUT).decode() + # No target writes before all local hashes and this read-only preflight pass. + print(ssh('set -eu\ntest -d /media/fat\ntest -w /media/fat\ntest -e /dev/MiSTer_cmd\ncommand -v sha256sum\nid\n').strip()) + remote='/media/fat/.coco3plus/install-'+stamp;backup=remote+'/backup';stage=remote+'/stage' + ssh('set -eu\nmkdir -p '+q(stage)+' '+q(backup)+'\n') + # Raw argv paths are intentional: OpenSSH SFTP handles spaces without shell quoting. + subprocess.run(['scp',*args,'-r',str(fat),target+':'+stage+'/'],check=True) + lines=['set -eu'] + for n,v in manifest['files'].items():lines.append('test "$(sha256sum '+q(stage+'/fat/'+n)+' | cut -d " " -f 1)" = '+q(v['sha256'])) + lines.append("printf 'load_core /media/fat/menu.rbf\\n' > /dev/MiSTer_cmd") + lines.append('sleep 2') + for n,v in manifest['files'].items(): + src=stage+'/fat/'+n;dest='/media/fat/'+n;old=backup+'/'+n + lines.append('mkdir -p '+q(str(PurePosixPath(dest).parent))+' '+q(str(PurePosixPath(old).parent))) + if v['policy']=='create-if-missing':lines.append('if [ ! -e '+q(dest)+' ]; then cp '+q(src)+' '+q(dest)+'; fi') + else: + lines.append('if [ -e '+q(dest)+' ]; then cp '+q(dest)+' '+q(old)+'; fi') + lines.append('cp '+q(src)+' '+q(dest)) + lines.append('test "$(sha256sum '+q(dest)+' | cut -d " " -f 1)" = '+q(v['sha256'])) + lines.append('sync') + if a.load:lines.append("printf 'load_core /media/fat/_Computer/Coco 3 Plus.mgl\\n' > /dev/MiSTer_cmd") + result=ssh('\n'.join(lines)+'\n') + receipt=dict(host=a.host,user=a.user,backup=backup,manifest=manifest,loaded=a.load,remote_output=result) + (release/'install-receipt.json').write_text(json.dumps(receipt,indent=2)+'\n') + print('Installed Coco 3 Plus; backup: '+backup+'; RBF '+manifest['rbf_sha256']) + print('Receipt: '+str(release/'install-receipt.json')) +if __name__=='__main__':main() diff --git a/tools/project_inputs.json b/tools/project_inputs.json new file mode 100644 index 0000000..efafee1 --- /dev/null +++ b/tools/project_inputs.json @@ -0,0 +1,179 @@ +{ + "description": "Maintained project input inventory. Add dependencies here and HDL assignments to files.qip. Historical provenance remains in validation/source-import.json.", + "files": [ + ".gitignore", + "AMW.stp", + "COCO3_Comp.xlsx", + "CoCo3.qpf", + "CoCo3.qsf", + "CoCo3.srf", + "CoCo3.sv", + "CoCo3FPGA.sdc", + "HD.stp", + "HD2.stp", + "README.md", + "Serial.stp", + "Video1.stp", + "Video_Explorer.stp", + "Video_Explorer2.stp", + "Vsync.stp", + "build_id_num.v", + "changes.txt", + "docs/Boot.vhd", + "docs/CoCo3FPGA.docx", + "docs/CoCo3FPGA.pdf", + "docs/~$Co3FPGA.docx", + "external-io.sdc", + "files.qip", + "pll.xml", + "releases/CoCo3_20211221.rbf", + "releases/CoCo3_20211229.rbf", + "releases/CoCo3_20220124.rbf", + "releases/CoCo3_20220211.rbf", + "releases/CoCo3_20220219.rbf", + "releases/CoCo3_20220226.rbf", + "releases/CoCo3_20230224.rbf", + "releases/CoCo3_20231023.rbf", + "releases/CoCo3_20240205.rbf", + "releases/CoCo3_20240318.rbf", + "releases/CoCo3_20240514.rbf", + "releases/CoCo3_20260927.rbf", + "releases/Tandy CoCo3 Overview.pdf", + "reset-cpu.sdc", + "reset.stp", + "rom_Exploror.stp1", + "rtl/AMW.v", + "rtl/Auto_Run.sv", + "rtl/CPU09/6809Data.pdf", + "rtl/CPU09/cpu09_119.vhd", + "rtl/CPU09/cpu09_122.vhd", + "rtl/CPU09/cpu09l_126.vhd", + "rtl/CPU09/cpu09l_126x.vhd", + "rtl/CPU09/cpu09l_127.vhd", + "rtl/CPU09/cpu09l_128.vhd", + "rtl/CPU09/cpu09l_128a.vhd", + "rtl/CPU09/cpu09new_B15.vhd", + "rtl/Cassette_Write.sv", + "rtl/CoCo3FPGA.sdc", + "rtl/EE_Cold_Bt.v", + "rtl/Mister_Video.v", + "rtl/OVO.vhd", + "rtl/PS2_Key/ps2_keyboard.v", + "rtl/UART_6551/6551rx.v", + "rtl/UART_6551/6551tx.v", + "rtl/UART_6551/uart_6551.v", + "rtl/VDAC.mif", + "rtl/VDAC.qip", + "rtl/VDAC.v", + "rtl/bh_mpi_config.sv", + "rtl/bh_mpi_rom.sv", + "rtl/bh_mpi_router.sv", + "rtl/cassette.v", + "rtl/coco3fpga.sv", + "rtl/coco_mem_fetch.sv", + "rtl/cocokey.v", + "rtl/config.sv", + "rtl/cpu_sdram_bridge.sv", + "rtl/fdc.sv", + "rtl/mc6809glb/mc6809glb.v", + "rtl/pll.ppf", + "rtl/pll.qip", + "rtl/pll.sip", + "rtl/pll.spd", + "rtl/pll.v", + "rtl/pll/pll_0002.qip", + "rtl/pll/pll_0002.v", + "rtl/ps2_mouse.v", + "rtl/rom/coco3_char_rom.vhd", + "rtl/rom/coco_rom_16.vhd", + "rtl/rom/coco_rom_32K.vhd", + "rtl/rom/coco_rom_8K.vhd", + "rtl/rom/coco_rom_cart.vhd", + "rtl/rtc.sv", + "rtl/sdc.sv", + "rtl/sdc_top.sv", + "rtl/sdram/sdram2.sv", + "rtl/square_gen.v", + "rtl/sram/coco_ram.vhd", + "rtl/sram/coco_vid_ram_buf.vhd", + "rtl/ssc/LICENSE", + "rtl/ssc/ssc_audio.sv", + "rtl/ssc/ssc_ay8913.sv", + "rtl/ssc/ssc_cartridge.sv", + "rtl/ssc/ssc_glue.sv", + "rtl/ssc/ssc_host.sv", + "rtl/ssc/ssc_mister_bridge.sv", + "rtl/ssc/ssc_sp0256.sv", + "rtl/ssc/ssc_sp0256_memory.sv", + "rtl/ssc/ssc_sp0256_tables.vh", + "rtl/ssc/ssc_tms7000.sv", + "rtl/ssc/ssc_tms7000_alu.sv", + "rtl/ssc/ssc_tms7000_bcd.sv", + "rtl/ssc/ssc_tms7000_decode.sv", + "rtl/ssc/ssc_tms7000_defs.vh", + "rtl/ssc/ssc_tms7000_exec.sv", + "rtl/ssc/ssc_tms7000_io.sv", + "rtl/ssc/ssc_tms7000_memory.sv", + "rtl/ssc/ssc_tms7000_pacer.sv", + "rtl/wd1793.sv", + "sys/alsa.sv", + "sys/arcade_video.v", + "sys/ascal.vhd", + "sys/audio_out.v", + "sys/build_id.tcl", + "sys/ddr_svc.sv", + "sys/f2sdram_safe_terminator.sv", + "sys/gamma_corr.sv", + "sys/hps_io.sv", + "sys/hq2x.sv", + "sys/i2c.v", + "sys/i2s.v", + "sys/iir_filter.v", + "sys/ltc2308.sv", + "sys/math.sv", + "sys/mcp23009.sv", + "sys/mt32pi.sv", + "sys/osd.v", + "sys/pll.13.qip", + "sys/pll_audio.13.qip", + "sys/pll_audio.qip", + "sys/pll_audio.v", + "sys/pll_audio/pll_audio_0002.qip", + "sys/pll_audio/pll_audio_0002.v", + "sys/pll_cfg.qip", + "sys/pll_cfg.v", + "sys/pll_cfg/altera_pll_reconfig_core.v", + "sys/pll_cfg/altera_pll_reconfig_top.v", + "sys/pll_cfg/pll_cfg.v", + "sys/pll_cfg/pll_cfg_hdmi.v", + "sys/pll_cfg_hdmi.v", + "sys/pll_hdmi.13.qip", + "sys/pll_hdmi.qip", + "sys/pll_hdmi.v", + "sys/pll_hdmi/pll_hdmi_0002.qip", + "sys/pll_hdmi/pll_hdmi_0002.v", + "sys/pll_hdmi_adj.vhd", + "sys/pll_q13.qip", + "sys/pll_q17.qip", + "sys/scandoubler.v", + "sys/scanlines.v", + "sys/sd_card.sv", + "sys/shadowmask.sv", + "sys/sigma_delta_dac.v", + "sys/spdif.v", + "sys/sys.qip", + "sys/sys.tcl", + "sys/sys_analog.tcl", + "sys/sys_dual_sdram.tcl", + "sys/sys_top.sdc", + "sys/sys_top.v", + "sys/sysmem.sv", + "sys/vga_out.sv", + "sys/video_cleaner.sv", + "sys/video_freak.sv", + "sys/video_freezer.sv", + "sys/video_mixer.sv", + "sys/yc_out.sv", + "uart-reset.sdc" + ] +} diff --git a/tools/release.py b/tools/release.py new file mode 100644 index 0000000..e00b3d2 --- /dev/null +++ b/tools/release.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +"""Create a checked, copyable MiSTer FAT-volume overlay from a standalone build.""" +import argparse,datetime,hashlib,json,shutil,subprocess,zipfile +from pathlib import Path +ROOT=Path(__file__).resolve().parents[1] +SSC={'pic-7040-510.bin':(4096,'0013cd78482cc5f2360fdf584e9ba51d34861e8ccd9d88247f1a54039c16c365'), + 'sp0256-al2.bin':(2048,'98c280fd082169c54081e503dfe7d7d9a6fd46d4ffcc973e199ea0e1d9bc1ac9')} +BOOT={'boot0.rom':(32768,'ad358430568250eb8330a37f85361d9ce67e5ae6d5a28c17b31802cd3953a5d2'), + 'boot1.rom':(8192,'1c40c5a74e72edaeecc2511fee1aab347eae2c3d5fc6778cb622e3df14d63157')} +def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest() +def checked(p,size,digest): + if not p.is_file() or p.stat().st_size!=size or sha(p)!=digest:raise RuntimeError('Missing or incorrect input: '+str(p)) + return p +def default_config(ssc): + # Main serializes cur_status[16] in byte order, low bits first. + # Audio / SDC / ROM / Floppy, startup Slot4, 512K; migrated-layout marker. + layout=6+(3<<3)+(1<<6)+(2<<9) + status=(1<<63)|(layout<<43)|(3<<12)|((1<<42) if ssc else 0) + return status.to_bytes(16,'little') +def make_release(output,build,roms,ssc,without_ssc=False,public=False): + record=json.loads((build/'build.json').read_text()) + if not record.get('passed'):raise RuntimeError('Successful standalone FPGA build required') + rbf=checked(build/'project/output_files/CoCo3.rbf',record['rbf_bytes'],record['rbf_sha256']) + for n,h in record['inputs'].items(): + if sha(ROOT/n)!=h:raise RuntimeError('Source differs from built input: '+n) + inputs={} if public else {f'games/coco3plus/{n}':checked(roms/n,*identity) for n,identity in BOOT.items()} + if not without_ssc and not public:inputs.update({f'games/coco3plus/{n}':checked(ssc/n,*v) for n,v in SSC.items()}) + if subprocess.check_output(['git','status','--porcelain','--untracked-files=no'],cwd=ROOT).strip():raise RuntimeError('Commit reviewed changes before creating a distributable source package') + source_revision=subprocess.check_output(['git','rev-parse','HEAD'],cwd=ROOT).decode().strip() + if output.exists():raise RuntimeError('Preserve previous release: '+str(output)) + fat=output/'fat';fat.mkdir(parents=True) + core=f'_Computer/.coco3plus/{record["rbf_sha256"][:12]}/coco3plus.rbf';inputs[core]=rbf + for name in ('NOTICE.md','LICENSING.md','COPYRIGHT.md'): + inputs['games/coco3plus/licenses/'+name]=ROOT/name + for folder in (ROOT/'LICENSES',): + for file in folder.glob('*'): + if file.is_file():inputs['games/coco3plus/licenses/'+file.name]=file + inputs['games/coco3plus/licenses/SSC-BSD-3-Clause.txt']=ROOT/'rtl/ssc/LICENSE' + for n,p in inputs.items(): + target=fat/n;target.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(p,target) + launcher=fat/'_Computer/Coco 3 Plus.mgl';launcher.parent.mkdir(exist_ok=True) + launcher.write_text(f'\n {core[:-4]}\n coco3plus\n\n',newline='\n') + config=fat/'config';config.mkdir() + (config/'coco3plus_v51.CFG').write_bytes(default_config(not without_ssc)) + if not without_ssc: + for index,n in ((4,'pic-7040-510.bin'),(5,'sp0256-al2.bin')): + value=f'/media/fat/games/coco3plus/{n}'.encode() + (config/f'coco3plus.f{index}').write_bytes(value.ljust(1024,b'\0')) + manifest=dict(format=1,created_utc=datetime.datetime.now(datetime.timezone.utc).isoformat(),public_package=public, + rbf_sha256=record['rbf_sha256'],ssc_included=not without_ssc and not public,roms_required_separately=public, + files={p.relative_to(fat).as_posix():dict(bytes=p.stat().st_size,sha256=sha(p), + policy='create-if-missing' if p.name=='coco3plus_v51.CFG' else 'backup-and-replace') for p in sorted(fat.rglob('*')) if p.is_file()}) + if public:manifest['required_roms']={n:dict(bytes=v[0],sha256=v[1]) for n,v in {**BOOT,**({} if without_ssc else SSC)}.items()} + (output/'manifest.json').write_text(json.dumps(manifest,indent=2)+'\n') + (output/'SHA256SUMS.txt').write_text(''.join(f'{v["sha256"]} fat/{n}\n' for n,v in manifest['files'].items())) + (output/'README.txt').write_text('Coco 3 Plus FAT-volume overlay. This is not a bootable disk image.\nCopy fat/ CONTENTS to the MiSTer FAT-volume root with MiSTer shut down.\nPreserve existing config/coco3plus_v51.CFG. Back up files before replacing.\nOriginal CoCo3 and other cores are not replaced. Start Computer/Coco 3 Plus.\nSSC ROMs, when included, are separately supplied local inputs; do not redistribute without permission.\n') + if public: + with (output/'README.txt').open('a') as file:file.write('PUBLIC CORE/SOURCE PACKAGE: no CoCo boot or SSC ROMs included.\nBefore launching, supply boot0.rom and boot1.rom in games/coco3plus and the SSC ROMs if using SSC.\nSee roms/README.md and docs/INSTALL.md in corresponding-source.zip for exact identities and source-build installation.\nThis incomplete-ROM public package is not accepted directly by the SSH installer. Build a complete local package using your own verified ROM inputs.\n') + # Git's reviewed committed tree is the only source-export allowlist. Untracked + # notes, .env files and ignored ROM/cache inputs can never enter this archive. + with (output/'corresponding-source.zip').open('xb') as file: + subprocess.run(['git','archive','--format=zip','--prefix=coco3plus/',source_revision],cwd=ROOT,stdout=file,check=True) + manifest['source_revision']=source_revision + manifest['corresponding_source_sha256']=sha(output/'corresponding-source.zip') + (output/'manifest.json').write_text(json.dumps(manifest,indent=2)+'\n') + archive_path=output.with_name(output.name+'.zip') + if archive_path.exists():raise RuntimeError('Preserve previous release archive: '+str(archive_path)) + with zipfile.ZipFile(archive_path,'x',zipfile.ZIP_DEFLATED) as archive: + for file in sorted(output.rglob('*')): + if file.is_file():archive.write(file,file.relative_to(output).as_posix()) + archive_path.with_suffix('.zip.sha256').write_text(sha(archive_path)+' '+archive_path.name+'\n') + return manifest +def main(): + p=argparse.ArgumentParser(description=__doc__) + p.add_argument('--output',type=Path,default=ROOT/'dist/coco3plus') + p.add_argument('--build',type=Path,default=ROOT/'build/fpga') + p.add_argument('--roms',type=Path,default=ROOT/'build/roms') + p.add_argument('--ssc',type=Path,default=ROOT/'roms/ssc') + p.add_argument('--without-ssc',action='store_true') + p.add_argument('--public',action='store_true',help='Omit ALL separately obtained/assembled ROMs; core/source distribution only') + a=p.parse_args();m=make_release(a.output.resolve(),a.build.resolve(),a.roms.resolve(),a.ssc.resolve(),a.without_ssc,a.public) + print('Release '+str(a.output.resolve())+'; RBF SHA-256 '+m['rbf_sha256']) +if __name__=='__main__':main() diff --git a/tools/timing_coverage.py b/tools/timing_coverage.py new file mode 100644 index 0000000..2831494 --- /dev/null +++ b/tools/timing_coverage.py @@ -0,0 +1,55 @@ +"""Conditional external timing coverage classification. +Copyright (c) 2026 Brian K. Holman. BSD-3-Clause; see LICENSES/. +""" +import re + +def parse_ucp(path): + text = path.read_text(errors='replace') + counts = {m[1].strip(): {'setup': int(m[2]), 'hold': int(m[3])} + for m in re.finditer(r';\s*(Illegal Clocks|Unconstrained [^;]+?)\s*;\s*(\d+)\s*;\s*(\d+)\s*;', text)} + inventory = {'input_ports': {}, 'output_ports': {}} + section = None + # Retain only the setup inventory (hold inventory repeats it). + for line in text.split('; Hold Analysis ;')[0].splitlines(): + cols = [x.strip() for x in line.split(';')[1:-1]] + if cols == ['Unconstrained Input Ports']: + section = 'input_ports' + elif cols == ['Unconstrained Output Ports']: + section = 'output_ports' + elif cols and cols[0] in ('Unconstrained Input Port Paths', 'Unconstrained Output Port Paths'): + section = None + elif section and len(cols) == 2 and cols[0] not in ('Input Port', 'Output Port'): + inventory[section][cols[0]] = cols[1] + if len(counts) != 6: + raise RuntimeError('Incomplete unconstrained-count summary') + return counts, inventory + + +def classify(port): + if port.startswith('SDRAM_'): + return 'SDRAM synchronous: must be explicitly timed; no exception allowed' + if port == 'HDMI_TX_CLK': + return 'Forwarded video clock: two generated-clock modes; clock waveform/output latency, not a data receiver' + if port.startswith('HDMI_TX_'): + return 'ADV7513 video: both clock mux modes require setup/hold budgets' + if port in ('HDMI_I2S', 'HDMI_LRCLK', 'HDMI_SCLK'): + return 'ADV7513 I2S: source protocol slots plus bounded output propagation' + if port == 'HDMI_MCLK': + return 'Forwarded audio clock: clock waveform/output latency, not a data receiver' + if port.startswith('HDMI_I2C_'): + return 'HPS hard I2C peripheral boundary: fabric STA does not prove slave bus timing' + if port in ('IO_SCL', 'IO_SDA'): + return 'MCP23009 I2C: require source-matched protocol slots, propagation and board RC/slave contract' + if port == 'SDCD_SPDIF': + return 'Mode-dependent asynchronous card detect / SPDIF output' + if port.startswith('SDIO_') or port == 'SD_SPI_CS': + return 'Mode-dependent HPS SD-SPI / analog VGA mux; cannot use one synchronous pin budget' + if port.startswith('LED['): + return 'Human status indicator / overtake mode; no synchronous external receiver' + if port == 'USER_IO[1]': + return 'Optional external UART input: UART synchronizer and direct bit-banged PIA fanout' + if port.startswith('USER_IO['): + return 'Open-drain serial/debug output or alternate I2S; receiver/RC is external' + if port.startswith('altera_reserved_'): + return 'Tool-generated JTAG interface: separate programming/test timing contract' + return 'UNCLASSIFIED: investigation required' diff --git a/tools/toolchain.json b/tools/toolchain.json new file mode 100644 index 0000000..5ae6189 --- /dev/null +++ b/tools/toolchain.json @@ -0,0 +1,36 @@ +{ + "lwtools_windows": { + "version": "4.25", + "url": "https://www.lwtools.ca/releases/lwtools/lwtools-4.25-win64.zip", + "archive": "lwtools-4.25-win64.zip", + "sha256": "c0c8a4d04600df2b5072de552ec37bcbf7162f6047918a56254a997ea2553ab4", + "lwasm_sha256": "8b7ee402f7de3bf8552cdf8317f7d64d9b27af4b60f1cf7bbee76b6f31d35d4d" + }, + "main_reference": { + "revision": "f47acd3d71d302893d8ad49dde4268223cd4c9f8", + "files": { + "user_io.cpp": { + "sha256": "33cf025197d119b20112ba4e92c0b0cbbf2d49726fc2aea8d42e40ed88b5673a", + "url": "https://github.com/MiSTer-devel/Main_MiSTer/blob/f47acd3d71d302893d8ad49dde4268223cd4c9f8/user_io.cpp" + }, + "file_io.cpp": { + "sha256": "752c2e3795c39af7ff6976ae7cac4dda40213fc1eddeb815baaf8c82cf659e20", + "url": "https://github.com/MiSTer-devel/Main_MiSTer/blob/f47acd3d71d302893d8ad49dde4268223cd4c9f8/file_io.cpp" + }, + "menu.cpp": { + "sha256": "3da4c1dc89873353f9ceb1447624c1041cdf6d8c7f4bcc05846f4999464c1698", + "url": "https://github.com/MiSTer-devel/Main_MiSTer/blob/f47acd3d71d302893d8ad49dde4268223cd4c9f8/menu.cpp" + }, + "user_io.h": { + "sha256": "89b00ba1b35560f83bc8190d2e648cbb5bb38f5fea1ff39243700beca38c5673", + "url": "https://github.com/MiSTer-devel/Main_MiSTer/blob/f47acd3d71d302893d8ad49dde4268223cd4c9f8/user_io.h" + } + } + }, + "oss_cad_windows": { + "version": "2026-11-14", + "url": "https://github.com/YosysHQ/oss-cad-suite-build/releases/download/2026-11-14/oss-cad-suite-windows-x64-20261114.tgz", + "archive": "oss-cad-suite-windows-x64-20261114.tgz", + "sha256": "3928bd7a49c6ba4cee27205b9df9f41829a518398db8abe964b8378206232d97" + } +} diff --git a/uart-reset.sdc b/uart-reset.sdc new file mode 100644 index 0000000..1c9642c --- /dev/null +++ b/uart-reset.sdc @@ -0,0 +1,12 @@ +# Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. +# Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. +# Narrow asynchronous reset-entry exceptions; no functional UART data cuts. +set cpu_release [get_registers {*RS232|cpu_reset_release[*]}] +set serial_release [get_registers {*RS232|serial_reset_release[*]}] +set tick_release [get_registers {*uart_tick_release[*]}] +if {[get_collection_size $cpu_release] != 2 || [get_collection_size $serial_release] != 2 || [get_collection_size $tick_release] != 2} { + error "Expected two stages in each UART reset tree" +} +set_false_path -from [get_registers {*coco3|reset_main_release[1]}] -to $cpu_release +set_false_path -from [get_registers {*coco3|reset_main_release[1] *RS232|RESET_NX}] -to $serial_release +set_false_path -from [get_registers {*coco3|reset_main_release[1]}] -to $tick_release diff --git a/validation/contributions.json b/validation/contributions.json new file mode 100644 index 0000000..dc38fc5 --- /dev/null +++ b/validation/contributions.json @@ -0,0 +1,127 @@ +{ + "copyright": "Copyright (c) 2026 Brian K. Holman", + "scope": "Original Plus contributions only; original component rights retained", + "modified_inherited_files": [ + ".gitignore", + "CoCo3.qsf", + "CoCo3.sv", + "README.md", + "files.qip", + "rtl/CoCo3FPGA.sdc", + "rtl/EE_Cold_Bt.v", + "rtl/UART_6551/6551rx.v", + "rtl/UART_6551/uart_6551.v", + "rtl/coco3fpga.sv", + "rtl/fdc.sv", + "rtl/mc6809glb/mc6809glb.v", + "rtl/sdc.sv", + "rtl/sdc_top.sv", + "rtl/sdram/sdram2.sv", + "sys/i2c.v", + "sys/mcp23009.sv" + ], + "new_project_files": [ + ".gitattributes", + "AGENTS.md", + "CHANGELOG.md", + "COPYRIGHT.md", + "LICENSES/Coco3Plus-BSD-3-Clause.txt", + "LICENSING.md", + "NOTICE.md", + "docs/BUG_FIXES.md", + "docs/BUILD_WINDOWS.md", + "docs/FEATURES.md", + "docs/INSTALL.md", + "docs/MENUS.md", + "docs/SD_IMAGE.md", + "docs/VALIDATION.md", + "external-io.sdc", + "reset-cpu.sdc", + "roms/README.md", + "rtl/bh_mpi_config.sv", + "rtl/bh_mpi_rom.sv", + "rtl/bh_mpi_router.sv", + "rtl/cpu_sdram_bridge.sv", + "rtl/ssc/LICENSE", + "rtl/ssc/ssc_audio.sv", + "rtl/ssc/ssc_ay8913.sv", + "rtl/ssc/ssc_cartridge.sv", + "rtl/ssc/ssc_glue.sv", + "rtl/ssc/ssc_host.sv", + "rtl/ssc/ssc_mister_bridge.sv", + "rtl/ssc/ssc_sp0256.sv", + "rtl/ssc/ssc_sp0256_memory.sv", + "rtl/ssc/ssc_sp0256_tables.vh", + "rtl/ssc/ssc_tms7000.sv", + "rtl/ssc/ssc_tms7000_alu.sv", + "rtl/ssc/ssc_tms7000_bcd.sv", + "rtl/ssc/ssc_tms7000_decode.sv", + "rtl/ssc/ssc_tms7000_defs.vh", + "rtl/ssc/ssc_tms7000_exec.sv", + "rtl/ssc/ssc_tms7000_io.sv", + "rtl/ssc/ssc_tms7000_memory.sv", + "rtl/ssc/ssc_tms7000_pacer.sv", + "scripts/bh_mpi_timing.tcl", + "scripts/coco3_bh_profile.py", + "scripts/external_io_timing.tcl", + "scripts/nmi_timing_paths.tcl", + "scripts/reset_cpu_timing_paths.tcl", + "scripts/rom_inputs.py", + "scripts/run_regressions.py", + "scripts/source_snapshot.py", + "scripts/ssc_integrated_timing.tcl", + "scripts/test_bh_menu.py", + "scripts/test_bh_mpi.py", + "scripts/test_bh_mpi_core.py", + "scripts/test_coco3_bh_startup.py", + "scripts/test_external_audio.py", + "scripts/test_external_i2c.py", + "scripts/test_external_pixel.py", + "scripts/test_external_sdram.py", + "scripts/test_external_sdram_commands.py", + "scripts/test_keyboard_control_phase.py", + "scripts/test_peripheral_phase.py", + "scripts/test_registered_interfaces.py", + "scripts/test_reset_domains.py", + "scripts/test_ssc_mister_system.py", + "scripts/test_video_sdram.py", + "scripts/uart_timing_paths.tcl", + "scripts/validation_common.py", + "scripts/video_timing_paths.tcl", + "tests/bh_mpi_core_tb.sv", + "tests/bh_mpi_startup_tb.sv", + "tests/bh_mpi_tb.sv", + "tests/boot_control_tb.sv", + "tests/bridge_protocol_tb.sv", + "tests/completion_phase_tb.sv", + "tests/cpu_sdram_bridge_tb.sv", + "tests/disk_buffer_pipeline_tb.sv", + "tests/external_audio_tb.sv", + "tests/external_i2c_tb.sv", + "tests/external_sdram_commands_tb.sv", + "tests/keyboard_control_phase_tb.sv", + "tests/peripheral_phase_tb.sv", + "tests/reset_domains_tb.sv", + "tests/ssc_mister_system_tb.sv", + "tests/test_release_guards.py", + "tests/test_tooling_guards.py", + "tests/video_sdram_tb.sv", + "tools/audit_timing.py", + "tools/bootstrap.py", + "tools/build_fpga.py", + "tools/build_roms.py", + "tools/cocoroms.json", + "tools/install_mister.py", + "tools/project_inputs.json", + "tools/release.py", + "tools/timing_coverage.py", + "tools/toolchain.json", + "uart-reset.sdc", + "windows/Build-FPGA.ps1", + "windows/Build-ROMs.ps1", + "windows/Install-MiSTer.ps1", + "windows/Package-Release.ps1", + "windows/Setup-Tools.ps1", + "windows/Test.ps1" + ] +} diff --git a/validation/deployment.json b/validation/deployment.json new file mode 100644 index 0000000..53ea787 --- /dev/null +++ b/validation/deployment.json @@ -0,0 +1,20 @@ +{ + "rbf_sha256": "768ee9db2923bf7b7acf7f57473c6c56f92d14ffc6d6bd88719148f80c9a2d42", + "installed_file_hashes_verified": 15, + "original_media_unchanged": 31, + "saved_profile_files_unchanged": 5, + "stock_core_unchanged": true, + "active_profile": "coco3plus", + "embedded_identity": "Coco 3 Plus", + "boot_roms_rebuilt": true, + "ssc_original_inputs_verified": true, + "observed": { + "basic_startup": true, + "print_1_plus_1": true, + "automatic_ssc_ready": true, + "orchestra90_assigned": true + }, + "physical_power_cycle": false, + "human_listening_on_this_build": false, + "scope": "Final installer activation observed through HDMI/JetKVM; BASIC and automatic SSC ready verified; canonical profile remains coco3plus and embedded identity is Coco 3 Plus; no new listening or physical power-cycle claim" +} diff --git a/validation/source-import.json b/validation/source-import.json new file mode 100644 index 0000000..5f982e0 --- /dev/null +++ b/validation/source-import.json @@ -0,0 +1,709 @@ +{ + "upstream": "https://github.com/MiSTer-devel/CoCo3_MiSTer", + "upstream_base": "8b8cf72d1fb4de1d05345de8d5b92ec2d500fcd2", + "qualified_image_sha256": "a4b6ef0b3641bbbc1b42de88502b677a1ec5e3809e2a17abf6f1e75c2a38451e", + "source_files": { + ".gitignore": { + "sha256": "5f0a52c988e7a0644e9ab47114cae190e0ac24ead0b3c3f7521b9c3b308abf33", + "qualified_input_sha256": "8fc6c7db2a0076a73f50138d81f7aba45772a321574c744f477a25d52d81b6bb" + }, + "AMW.stp": { + "sha256": "59799b5d57c9657ef6b2028999bea2cb794953a3fe3c68b2dc3fce75368d0813", + "qualified_input_sha256": "59799b5d57c9657ef6b2028999bea2cb794953a3fe3c68b2dc3fce75368d0813" + }, + "COCO3_Comp.xlsx": { + "sha256": "938d7504986d35669bd20857c7c29dcafa538a9cfed3cc70595b06d1893004e2", + "qualified_input_sha256": "938d7504986d35669bd20857c7c29dcafa538a9cfed3cc70595b06d1893004e2" + }, + "CoCo3.qpf": { + "sha256": "44babfe2642e6f7a566ae773481bacc83aa59343cc7d49237592f3f525f5bbc6", + "qualified_input_sha256": "44babfe2642e6f7a566ae773481bacc83aa59343cc7d49237592f3f525f5bbc6" + }, + "CoCo3.qsf": { + "sha256": "267d2b49871f975595493fe3afc35497997651397d62954ee2ee5d56cabfb834", + "qualified_input_sha256": "b7699ab00d24dad901589a9302d1d59ff71979d7c7a60d07fb081b083fa6bac3" + }, + "CoCo3.srf": { + "sha256": "49989d3f5b93bba318e096f04e717c5a2be68f42fb14ee37c10d460255b62bf7", + "qualified_input_sha256": "49989d3f5b93bba318e096f04e717c5a2be68f42fb14ee37c10d460255b62bf7" + }, + "CoCo3.sv": { + "sha256": "3862fa092512f355038d3ac6bd8c01aa895da0310e2b721d25d555b4c76175ab", + "qualified_input_sha256": "8159b98887abedac58ca11f2d1c7a9e118305242079fbdf33b26aaa1045f0951" + }, + "CoCo3FPGA.sdc": { + "sha256": "7a0602fa0a15da3a2be98291ed2a04752b3ec8d256db8bd33718aa138b01866c", + "qualified_input_sha256": "7a0602fa0a15da3a2be98291ed2a04752b3ec8d256db8bd33718aa138b01866c" + }, + "HD.stp": { + "sha256": "c29540dbcc56deaa91bd4a838759cf9462250b2cd225cf551f4acf2598422f1a", + "qualified_input_sha256": "c29540dbcc56deaa91bd4a838759cf9462250b2cd225cf551f4acf2598422f1a" + }, + "HD2.stp": { + "sha256": "b29d028394d5260a31a1ee59b1b595b951dd5201bdb12dd470674a2cee3a2681", + "qualified_input_sha256": "b29d028394d5260a31a1ee59b1b595b951dd5201bdb12dd470674a2cee3a2681" + }, + "README.md": { + "sha256": "98f6b0ef7aaf3f838837cab5451837457b773b07350e51f1bd1e9cf915732e31", + "qualified_input_sha256": "fea690f7630edcf15ddac3b25c60be2f44da7e9af9283ed9c4b24ea519a4742f" + }, + "Serial.stp": { + "sha256": "e5ffa5dfc5d3496ccb7227cbbdb42c5e78a849a3933c5a8ea5c56746068b1ded", + "qualified_input_sha256": "e5ffa5dfc5d3496ccb7227cbbdb42c5e78a849a3933c5a8ea5c56746068b1ded" + }, + "Video1.stp": { + "sha256": "e94f9baae2ee75cd419494b385546876b7a3633c5f2c61b5ac51bec182804f03", + "qualified_input_sha256": "e94f9baae2ee75cd419494b385546876b7a3633c5f2c61b5ac51bec182804f03" + }, + "Video_Explorer.stp": { + "sha256": "66fde5d09c3c54054726b6cd4c5c5e44ddd199cbf418484081d86d02fc4017d6", + "qualified_input_sha256": "66fde5d09c3c54054726b6cd4c5c5e44ddd199cbf418484081d86d02fc4017d6" + }, + "Video_Explorer2.stp": { + "sha256": "b125d02059c7871a068b3b0128dc2e6f075bc0c5c666e91eb4fe108445b12983", + "qualified_input_sha256": "b125d02059c7871a068b3b0128dc2e6f075bc0c5c666e91eb4fe108445b12983" + }, + "Vsync.stp": { + "sha256": "51e8856a42caaa2652efec0afaa9521ab0047d77a7d28f473e5b1c0936fd5386", + "qualified_input_sha256": "51e8856a42caaa2652efec0afaa9521ab0047d77a7d28f473e5b1c0936fd5386" + }, + "build_id_num.v": { + "sha256": "83a1d8652f3307af5b693d8569d6929c8ea08e3a88b82176e658e67a6d2954eb", + "qualified_input_sha256": "83a1d8652f3307af5b693d8569d6929c8ea08e3a88b82176e658e67a6d2954eb" + }, + "changes.txt": { + "sha256": "046e69ffe9bab28942f87bafe0b9c6fa92309faa0dee2f7b78fd6cec17113a55", + "qualified_input_sha256": "046e69ffe9bab28942f87bafe0b9c6fa92309faa0dee2f7b78fd6cec17113a55" + }, + "docs/Boot.vhd": { + "sha256": "9bc0f35dc6f57cc3623146d20f817ac92da24f00d1441f0bf40700753ee323a1", + "qualified_input_sha256": "9bc0f35dc6f57cc3623146d20f817ac92da24f00d1441f0bf40700753ee323a1" + }, + "docs/CoCo3FPGA.docx": { + "sha256": "f5be57bedeb58de620f4cd8914d1c466a38e326fbad138cb033d96afa8fe1d0d", + "qualified_input_sha256": "f5be57bedeb58de620f4cd8914d1c466a38e326fbad138cb033d96afa8fe1d0d" + }, + "docs/CoCo3FPGA.pdf": { + "sha256": "71c47607d12125c5486dad7d1d4ede7dc9a28389ba6216fa237b4ee69f32193a", + "qualified_input_sha256": "71c47607d12125c5486dad7d1d4ede7dc9a28389ba6216fa237b4ee69f32193a" + }, + "docs/~$Co3FPGA.docx": { + "sha256": "99f30a3eeb8e6c9dc78fded13fedbf750beb536f80d6ef82b16362cee6b92d9b", + "qualified_input_sha256": "99f30a3eeb8e6c9dc78fded13fedbf750beb536f80d6ef82b16362cee6b92d9b" + }, + "external-io.sdc": { + "sha256": "67694509f8bb3323008de762076781f9ac542a493ecfc59292073983446d3278", + "qualified_input_sha256": "cddeb54464575d275bcb670da6e61cabe79295115833207aab2f7c420f33c47b" + }, + "files.qip": { + "sha256": "ad042eb6fb28f1443f1af562be264e80552e5d47fae37553e849db18936fd51a", + "qualified_input_sha256": "21158bc43a6219a709f126bb55c3530ae4b93d41a0408ccd0f02c853e74371e4" + }, + "pll.xml": { + "sha256": "fcaa430f0aa361bc4a4c8f9bf9f524b31bf0c8915330821fc843120f08e33d9c", + "qualified_input_sha256": "fcaa430f0aa361bc4a4c8f9bf9f524b31bf0c8915330821fc843120f08e33d9c" + }, + "releases/CoCo3_20211221.rbf": { + "sha256": "2b11bffe31cc6b18b7b0d3099d445f4d624848ba7c0ba919f614c072fb15ef96", + "qualified_input_sha256": "2b11bffe31cc6b18b7b0d3099d445f4d624848ba7c0ba919f614c072fb15ef96" + }, + "releases/CoCo3_20211229.rbf": { + "sha256": "bf68e13febc5dd9319a7c5ba955eb8309578c8cd96ea952eea7a96853d376859", + "qualified_input_sha256": "bf68e13febc5dd9319a7c5ba955eb8309578c8cd96ea952eea7a96853d376859" + }, + "releases/CoCo3_20220124.rbf": { + "sha256": "09be803a776f1baaba948dd62678e5edd4107d6d274200e49e76dcd3e32e5729", + "qualified_input_sha256": "09be803a776f1baaba948dd62678e5edd4107d6d274200e49e76dcd3e32e5729" + }, + "releases/CoCo3_20220211.rbf": { + "sha256": "ddc50b452885f4440227da1c8e87b017cc007ee7048a29315235a31038fc5794", + "qualified_input_sha256": "ddc50b452885f4440227da1c8e87b017cc007ee7048a29315235a31038fc5794" + }, + "releases/CoCo3_20220219.rbf": { + "sha256": "429aaf5ad6f7c5f8467c9551d76651a79840daf6292ce9e93a576ed48097c574", + "qualified_input_sha256": "429aaf5ad6f7c5f8467c9551d76651a79840daf6292ce9e93a576ed48097c574" + }, + "releases/CoCo3_20220226.rbf": { + "sha256": "89422a751fcbcd604140ceec9db0a1f89fa67d28188caaecea773856c3c82082", + "qualified_input_sha256": "89422a751fcbcd604140ceec9db0a1f89fa67d28188caaecea773856c3c82082" + }, + "releases/CoCo3_20230224.rbf": { + "sha256": "872792ba23727478f79dad545703b46a89cfd2d3a741ca0aa3d8240e5e6305a5", + "qualified_input_sha256": "872792ba23727478f79dad545703b46a89cfd2d3a741ca0aa3d8240e5e6305a5" + }, + "releases/CoCo3_20231023.rbf": { + "sha256": "daf8d0645722ffdb46594ba2996b96aa53b4c9a270782fc9c3bfff6f26e1ac17", + "qualified_input_sha256": "daf8d0645722ffdb46594ba2996b96aa53b4c9a270782fc9c3bfff6f26e1ac17" + }, + "releases/CoCo3_20240205.rbf": { + "sha256": "817dcb4c6e95d1f2ce1e1f3a2e4e8e70c2ec9fcb1f497b20f0fcb8dea6dff8b6", + "qualified_input_sha256": "817dcb4c6e95d1f2ce1e1f3a2e4e8e70c2ec9fcb1f497b20f0fcb8dea6dff8b6" + }, + "releases/CoCo3_20240318.rbf": { + "sha256": "1eb57f5c3c2dd42a24d4a6cff6aa77004e3627bc005f268949f9b6720e437e20", + "qualified_input_sha256": "1eb57f5c3c2dd42a24d4a6cff6aa77004e3627bc005f268949f9b6720e437e20" + }, + "releases/CoCo3_20240514.rbf": { + "sha256": "a6d23c62f6d1e12608f567a9da4997e99b1d22fb838f29e09e56dab8774bd845", + "qualified_input_sha256": "a6d23c62f6d1e12608f567a9da4997e99b1d22fb838f29e09e56dab8774bd845" + }, + "releases/CoCo3_20260927.rbf": { + "sha256": "1f73c6628b5b78a7efe8cfe3a7bb60fb05d7dc9f9f4d3e95771ee4464ecb44e3", + "qualified_input_sha256": "1f73c6628b5b78a7efe8cfe3a7bb60fb05d7dc9f9f4d3e95771ee4464ecb44e3" + }, + "releases/Tandy CoCo3 Overview.pdf": { + "sha256": "249cace4054292cc84bd26e2f533f73cf554e6f148db9b58b8c60a6c5910eadb", + "qualified_input_sha256": "249cace4054292cc84bd26e2f533f73cf554e6f148db9b58b8c60a6c5910eadb" + }, + "reset-cpu.sdc": { + "sha256": "87dac9d08fb26243cf8b90249b5ad8547590796241d2cfc94b688114318925e7", + "qualified_input_sha256": "8046e5e571626e3091afeabc2cd13520e3eb996a70abbfbb71c946aec97f79cd" + }, + "reset.stp": { + "sha256": "1a9450490d28af0915d7e1ff2606cfdf2b22f1bddb64a4bac175d242720c5217", + "qualified_input_sha256": "1a9450490d28af0915d7e1ff2606cfdf2b22f1bddb64a4bac175d242720c5217" + }, + "rom_Exploror.stp1": { + "sha256": "c5bf08a6bf6cf5fc51341d56ba61a0cf99a984e63138d2dfab47dcc58e1a72bb", + "qualified_input_sha256": "c5bf08a6bf6cf5fc51341d56ba61a0cf99a984e63138d2dfab47dcc58e1a72bb" + }, + "rtl/AMW.v": { + "sha256": "748ee9fb6d8b7bde1c9f4f6b619a06eb6e5858b9f46e641236d32e1798089fa0", + "qualified_input_sha256": "748ee9fb6d8b7bde1c9f4f6b619a06eb6e5858b9f46e641236d32e1798089fa0" + }, + "rtl/Auto_Run.sv": { + "sha256": "ad57906fb7adf5685f8f3078f7355741386bb3cc014df2f62147ad46d12f1466", + "qualified_input_sha256": "ad57906fb7adf5685f8f3078f7355741386bb3cc014df2f62147ad46d12f1466" + }, + "rtl/CPU09/6809Data.pdf": { + "sha256": "f5fc61a75bad046277f6faeb8b25abb123a0ceeb7470b369b89310451b12d756", + "qualified_input_sha256": "f5fc61a75bad046277f6faeb8b25abb123a0ceeb7470b369b89310451b12d756" + }, + "rtl/CPU09/cpu09_119.vhd": { + "sha256": "6bc7971aeed4b8a75bc0035e71efb472d17e6bd248202ce7a15cf3c9df317fce", + "qualified_input_sha256": "6bc7971aeed4b8a75bc0035e71efb472d17e6bd248202ce7a15cf3c9df317fce" + }, + "rtl/CPU09/cpu09_122.vhd": { + "sha256": "4ec882cc35b344cd3aa15e90a1167f15d6e8966ea5c7c80c467f830f9ea1ebb7", + "qualified_input_sha256": "4ec882cc35b344cd3aa15e90a1167f15d6e8966ea5c7c80c467f830f9ea1ebb7" + }, + "rtl/CPU09/cpu09l_126.vhd": { + "sha256": "c1a4569d8326b7ecb5fc0bbb6138593eb4ce3aa35453bc246e28062713fd4d14", + "qualified_input_sha256": "c1a4569d8326b7ecb5fc0bbb6138593eb4ce3aa35453bc246e28062713fd4d14" + }, + "rtl/CPU09/cpu09l_126x.vhd": { + "sha256": "4b0f881053f367938ef6da574ec4e1ae7d5a35b6080d1ef3b77c8ec21577c37d", + "qualified_input_sha256": "4b0f881053f367938ef6da574ec4e1ae7d5a35b6080d1ef3b77c8ec21577c37d" + }, + "rtl/CPU09/cpu09l_127.vhd": { + "sha256": "b4f88758cadcd57fdb626ad42a7558a23da732f8f0a580e1c92b4c5c9b0d80bf", + "qualified_input_sha256": "b4f88758cadcd57fdb626ad42a7558a23da732f8f0a580e1c92b4c5c9b0d80bf" + }, + "rtl/CPU09/cpu09l_128.vhd": { + "sha256": "f49ed673a2d6580d093c2cba8e11eb19306dac1d77a3eac9580402a4f4bcca31", + "qualified_input_sha256": "f49ed673a2d6580d093c2cba8e11eb19306dac1d77a3eac9580402a4f4bcca31" + }, + "rtl/CPU09/cpu09l_128a.vhd": { + "sha256": "fbbb24ceabd32a98e9ebb9f303c841faf4a7c2e699709dafba952c4fc85eac45", + "qualified_input_sha256": "fbbb24ceabd32a98e9ebb9f303c841faf4a7c2e699709dafba952c4fc85eac45" + }, + "rtl/CPU09/cpu09new_B15.vhd": { + "sha256": "880190fe7684c9139d62b6dc7d84c5816bb9a40a2523fd7511a7b320baeb9f8a", + "qualified_input_sha256": "880190fe7684c9139d62b6dc7d84c5816bb9a40a2523fd7511a7b320baeb9f8a" + }, + "rtl/Cassette_Write.sv": { + "sha256": "f335e44c6827aca2f8756fdf4c090b9136ed625a217847e8f953701c11f367c1", + "qualified_input_sha256": "f335e44c6827aca2f8756fdf4c090b9136ed625a217847e8f953701c11f367c1" + }, + "rtl/CoCo3FPGA.sdc": { + "sha256": "98dd3b41bf28ae3555f8fe3e13e36d156ef35093115cf08e2bda236dc81620e8", + "qualified_input_sha256": "f0fd54e33080573587778e5b94fbe240a456e31bdfbf49d9e3bf82081e25d5c6" + }, + "rtl/EE_Cold_Bt.v": { + "sha256": "53265384140471177152839224e80ce9dea3a58aeca077fd493183aa8250dd8f", + "qualified_input_sha256": "69bd0ae31f919a4ffc7cb36e62f95e89283e9fe5c1f2984055d8d3863eebd686" + }, + "rtl/Mister_Video.v": { + "sha256": "83500e27d8e50d19580bf337b088064a569ad4e0b536123c421b9cf2593a4878", + "qualified_input_sha256": "83500e27d8e50d19580bf337b088064a569ad4e0b536123c421b9cf2593a4878" + }, + "rtl/OVO.vhd": { + "sha256": "15e3d48657cf461fe3c17d5c2a26001248d4ad12d5ae015c3dd8ca19679165b9", + "qualified_input_sha256": "15e3d48657cf461fe3c17d5c2a26001248d4ad12d5ae015c3dd8ca19679165b9" + }, + "rtl/PS2_Key/ps2_keyboard.v": { + "sha256": "6eec7c87a77cd1adefa41323afb8d3384fc20e83cfc7e5c15df316ee0c5aeebe", + "qualified_input_sha256": "6eec7c87a77cd1adefa41323afb8d3384fc20e83cfc7e5c15df316ee0c5aeebe" + }, + "rtl/UART_6551/6551rx.v": { + "sha256": "fb68c3c4b99970209ec6c389329901d53bc34e317c99d9cb79dda7d3ed0ccad7", + "qualified_input_sha256": "e117c408f2b84fa7ce16a8f5d83331117bed58dbd874d8979cb6dc2bbc03e276" + }, + "rtl/UART_6551/6551tx.v": { + "sha256": "025c9117bf47ce60875cc7c3ec9f32bcfc0dab9af1d448b89e06705be7396bbf", + "qualified_input_sha256": "025c9117bf47ce60875cc7c3ec9f32bcfc0dab9af1d448b89e06705be7396bbf" + }, + "rtl/UART_6551/uart_6551.v": { + "sha256": "72a04083920a24736181d157a1ffdaf1581369efb0e41a65365bfe1e9dfa2bd8", + "qualified_input_sha256": "80bb9baf9f122d37c46c5385d2d30cd29bd524bd44e3e689ed42b0d0a403066f" + }, + "rtl/VDAC.mif": { + "sha256": "e195a39cbd63e4045c319770b1724bf74d076dfd39ea4a76824f00178e7ebf80", + "qualified_input_sha256": "e195a39cbd63e4045c319770b1724bf74d076dfd39ea4a76824f00178e7ebf80" + }, + "rtl/VDAC.qip": { + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "qualified_input_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "rtl/VDAC.v": { + "sha256": "8fee8b34d709472748b2102ab94ab30b5d621a1f9ed5f8d0744c2199c148ea8c", + "qualified_input_sha256": "8fee8b34d709472748b2102ab94ab30b5d621a1f9ed5f8d0744c2199c148ea8c" + }, + "rtl/bh_mpi_config.sv": { + "sha256": "cb42863dad207370ccba35e41c2e6018fabd801d6b68b877f5a9031abf0569db", + "qualified_input_sha256": "8611c0af0a12235c864821c39af302e1123a65131a66db04adcc5cb982c8445a" + }, + "rtl/bh_mpi_rom.sv": { + "sha256": "dad86cec0f5a92ed522015b85d928337776cf3ad91ec7362d487334831fdc382", + "qualified_input_sha256": "a68f659cefb1b27c4dd47a99a5589918cb545b9d686001fbfdee295f32426c22" + }, + "rtl/bh_mpi_router.sv": { + "sha256": "5ec1810afa4fe1b362605955be476968967ca791a38a9bd2bb01c246897ec2c4", + "qualified_input_sha256": "4277b3e7a998f217582ac14b73d0265667cafa3053e551b4017a39526bb0646f" + }, + "rtl/cassette.v": { + "sha256": "83e741835c3d90c9a4ec573593c1ec05bad86fae22d680ea047e3d5b64adda5e", + "qualified_input_sha256": "83e741835c3d90c9a4ec573593c1ec05bad86fae22d680ea047e3d5b64adda5e" + }, + "rtl/coco3fpga.sv": { + "sha256": "39be81ca39760850b0d44c7a2af15225ccbc24d3bea6a75eaa40f58d1d75a7e0", + "qualified_input_sha256": "7cc48b91257706778dd8ac5d2b9c0d5a842b6f6e4047048d4c292fe2a4e84c64" + }, + "rtl/coco_mem_fetch.sv": { + "sha256": "d9d871ec0ff12eaee889888a5876f320417f96b572b2ca16153f1007e568ee71", + "qualified_input_sha256": "d9d871ec0ff12eaee889888a5876f320417f96b572b2ca16153f1007e568ee71" + }, + "rtl/cocokey.v": { + "sha256": "37c14e7e48fd7d74bbee6abe530ba45c554f73ca6fb9bdeb70f46dfa4fe55bb6", + "qualified_input_sha256": "37c14e7e48fd7d74bbee6abe530ba45c554f73ca6fb9bdeb70f46dfa4fe55bb6" + }, + "rtl/config.sv": { + "sha256": "8a2a74e0c8d58410432f365b96dd5cf5bb54d877627997b6b919131f7821fdf4", + "qualified_input_sha256": "8a2a74e0c8d58410432f365b96dd5cf5bb54d877627997b6b919131f7821fdf4" + }, + "rtl/cpu_sdram_bridge.sv": { + "sha256": "2ac82076548ea235ed5d1c9ef438ae7452f190aecab31a29bc650c8d84ed875d", + "qualified_input_sha256": "fc2ce28246bbf5490fc87e7c6fc817cf85520bae80b1abec070ef7deaadd21aa" + }, + "rtl/fdc.sv": { + "sha256": "ea3076a0752b4674b4394c93f12a109237fdbe86737956bccec85e737e11110e", + "qualified_input_sha256": "2f2c5d2ba2c379b99ea67713ad364cafb0cfdd2a646dc461dff17fb6ff45990b" + }, + "rtl/mc6809glb/mc6809glb.v": { + "sha256": "29c84e1bf316fdd5a1a8b7a0343569a30e4b8ea0e4809e6fa1f6d4bd899ca00e", + "qualified_input_sha256": "540bd983c45073fd47c187b17f7d92cc1ff25798fcb87137ca2b8a353f23cb46" + }, + "rtl/pll.ppf": { + "sha256": "d8deb975a2d5826c460c5f6446860dfe85babd23905d42e2a5c2e77a08433dbd", + "qualified_input_sha256": "d8deb975a2d5826c460c5f6446860dfe85babd23905d42e2a5c2e77a08433dbd" + }, + "rtl/pll.qip": { + "sha256": "70215fd33c10af64df666f32faed94ab4d3c145b997c414dcb30342cf37f184c", + "qualified_input_sha256": "70215fd33c10af64df666f32faed94ab4d3c145b997c414dcb30342cf37f184c" + }, + "rtl/pll.sip": { + "sha256": "e675771bdb4b484889c1518a1b94ddd62a887e63e1f7d693742dab4ee2be5f8c", + "qualified_input_sha256": "e675771bdb4b484889c1518a1b94ddd62a887e63e1f7d693742dab4ee2be5f8c" + }, + "rtl/pll.spd": { + "sha256": "b6c257356adbd72ca3bafecfcd19a9fc949be025ce81b9952307a8389f6a7b2f", + "qualified_input_sha256": "b6c257356adbd72ca3bafecfcd19a9fc949be025ce81b9952307a8389f6a7b2f" + }, + "rtl/pll.v": { + "sha256": "58c479233d7baf971f7f2532dc145775e08e8c8c3956ab8681563aad7e09ecfe", + "qualified_input_sha256": "58c479233d7baf971f7f2532dc145775e08e8c8c3956ab8681563aad7e09ecfe" + }, + "rtl/pll/pll_0002.qip": { + "sha256": "87733565096fce9f034019ca43b32dcb6b2c2413999fccd3d5dcf3e3191652d2", + "qualified_input_sha256": "87733565096fce9f034019ca43b32dcb6b2c2413999fccd3d5dcf3e3191652d2" + }, + "rtl/pll/pll_0002.v": { + "sha256": "38b4a07902f5602361e1b923a0c9cd3271976b375e2cc17137e9f3b3f29c3938", + "qualified_input_sha256": "38b4a07902f5602361e1b923a0c9cd3271976b375e2cc17137e9f3b3f29c3938" + }, + "rtl/ps2_mouse.v": { + "sha256": "60f0f8cc82cd41728a2e0414d54058934a33d7b80309840e6461676457d2689c", + "qualified_input_sha256": "60f0f8cc82cd41728a2e0414d54058934a33d7b80309840e6461676457d2689c" + }, + "rtl/rom/coco3_char_rom.vhd": { + "sha256": "83735477cdad66a1549f45401c6651c75271f81f880b54eef2bba94502555707", + "qualified_input_sha256": "83735477cdad66a1549f45401c6651c75271f81f880b54eef2bba94502555707" + }, + "rtl/rom/coco_rom_16.vhd": { + "sha256": "0e39fdc3a2fe1938c23a7146ed04a35cc13a44ba39bd1c29bebb3132412fae90", + "qualified_input_sha256": "0e39fdc3a2fe1938c23a7146ed04a35cc13a44ba39bd1c29bebb3132412fae90" + }, + "rtl/rom/coco_rom_32K.vhd": { + "sha256": "219d07d8d81da38178b3b2f39387b96619420098805a7a8866cbff7bbc969271", + "qualified_input_sha256": "219d07d8d81da38178b3b2f39387b96619420098805a7a8866cbff7bbc969271" + }, + "rtl/rom/coco_rom_8K.vhd": { + "sha256": "5e90985003715c029235bb41e8bb6bfc0abc3bc77239fae4a77c947f5bcafeb1", + "qualified_input_sha256": "5e90985003715c029235bb41e8bb6bfc0abc3bc77239fae4a77c947f5bcafeb1" + }, + "rtl/rom/coco_rom_cart.vhd": { + "sha256": "dd7675b06f908a97d39cb7ca973fb8be050e37d01097d206e8142762af9ff908", + "qualified_input_sha256": "dd7675b06f908a97d39cb7ca973fb8be050e37d01097d206e8142762af9ff908" + }, + "rtl/rtc.sv": { + "sha256": "e1816ac2a250aad5417a6c007f819dc00bdff6c531c90fb13e86906e79cefc8a", + "qualified_input_sha256": "e1816ac2a250aad5417a6c007f819dc00bdff6c531c90fb13e86906e79cefc8a" + }, + "rtl/sdc.sv": { + "sha256": "5aa768daa6af438f7aadfa3fd247a3b09fc7787a3e805a9ae26690bb23e17f68", + "qualified_input_sha256": "ac1c47eb70b73bc66d12f4750344124d7000bcfc39d2a54c47f6bc724e9deeee" + }, + "rtl/sdc_top.sv": { + "sha256": "df869df91f59d84a044140cf048d5605632f0bcd0078049790854acc50d433ce", + "qualified_input_sha256": "e397d1c89133da32f905ee8bc3e403245ca00ce54c190fc2b90ce7d0cdb9b169" + }, + "rtl/sdram/sdram2.sv": { + "sha256": "43ff3eb494b4d65b83467a9426ab1a7d9208e96e3bac4a21f4ef4b9faeac5e59", + "qualified_input_sha256": "8572d0c5884ff7936314a4c7a37f58753ce17921b444cec296b6be83e7f9f14e" + }, + "rtl/square_gen.v": { + "sha256": "908ebcfe32865780d15499078e717b39e19ebe1c3f8315bcbab1418387924d5e", + "qualified_input_sha256": "908ebcfe32865780d15499078e717b39e19ebe1c3f8315bcbab1418387924d5e" + }, + "rtl/sram/coco_ram.vhd": { + "sha256": "8f61548abaf74d08462370f75b826e498be123cb5b453952894d63c65906d596", + "qualified_input_sha256": "8f61548abaf74d08462370f75b826e498be123cb5b453952894d63c65906d596" + }, + "rtl/sram/coco_vid_ram_buf.vhd": { + "sha256": "d977d473ea0d773ccb7aee81ed4202f9976ba5854ea3ae0189432cbfe99f9be3", + "qualified_input_sha256": "d977d473ea0d773ccb7aee81ed4202f9976ba5854ea3ae0189432cbfe99f9be3" + }, + "rtl/ssc/LICENSE": { + "sha256": "204dd45efd32cbf07d425b03bb19e9e9da48d32036fe2b5ceb81d56ed502dc71", + "qualified_input_sha256": "204dd45efd32cbf07d425b03bb19e9e9da48d32036fe2b5ceb81d56ed502dc71" + }, + "rtl/ssc/ssc_audio.sv": { + "sha256": "1e368e0eb6a4f58ca29d0c0b69352b52709dc58cae548549da8f9377aaf3caa8", + "qualified_input_sha256": "202d598434d6cc8eca9d3c72716ee1fd38030ceb5a60ccdc383a470a7081786e" + }, + "rtl/ssc/ssc_ay8913.sv": { + "sha256": "a21fbded914d3d2a5eb8b4b080f5140d0018116335860c976aea6d11da8e7a5f", + "qualified_input_sha256": "a64d742ca34e4daf5f8d131a2bd008d1679236ea8338a46254ab07778a982685" + }, + "rtl/ssc/ssc_cartridge.sv": { + "sha256": "50df91d332f19f6d4ad302f9dc6774052f58a075bd13c6d3835f4e4993b0d4c3", + "qualified_input_sha256": "2051f666d96b865b40cbdedbba709790139a3020583aa6374d7edd714dcb7fca" + }, + "rtl/ssc/ssc_glue.sv": { + "sha256": "f91f20146447bde4f938110460845bbc055fbe258f47517e430050a6de890994", + "qualified_input_sha256": "8c900f618f668e2ee81d4d777040bf7b29e8ff05e0cf800de71f59f524293875" + }, + "rtl/ssc/ssc_host.sv": { + "sha256": "a92a2d9ad6df056d7a15eb89c9fe8199090c02422b6313c4a6d55b218a27f7bd", + "qualified_input_sha256": "07c6d3138f975d33d9dddccffbffbb8b217dd2f0241eb125a42a27f2c97db39f" + }, + "rtl/ssc/ssc_mister_bridge.sv": { + "sha256": "0986a4e97bf7887f48f076a5b0f4a19981f69103bf11d0083f9a1c7c882557d1", + "qualified_input_sha256": "86b6412c05103fd7752f0a236a02e613a39c3fc83f583f7abd28ffe82ed4e424" + }, + "rtl/ssc/ssc_sp0256.sv": { + "sha256": "43e045008d6aa8f867e5c9fd800666ab531e194c6cde6d936a1669b8e5d148c2", + "qualified_input_sha256": "cdb4c17637e4f00646c3035cc8c66b835670023d1ad38960ee69181af142e0d7" + }, + "rtl/ssc/ssc_sp0256_memory.sv": { + "sha256": "68d2da460a216741ec6c2119202761a3eaaf4e6ad92362698f4915495a9bdc05", + "qualified_input_sha256": "f035b9a39917dd57ce502f179ea2590793d74818721639be66bd9d316cdec608" + }, + "rtl/ssc/ssc_sp0256_tables.vh": { + "sha256": "4cd641a20916208c776ee57478f5ead9e16ceecab770f1c357972fb14496daec", + "qualified_input_sha256": "1a3dab071372c3903c8d0d33f46980fc75bf9e5a3610fac6d19b088dd9cc4418" + }, + "rtl/ssc/ssc_tms7000.sv": { + "sha256": "88910f452e10b9b07521d81e7ee1803da80ead98d8d988a78d6d933a221e2928", + "qualified_input_sha256": "d7f763465c468323f41dd402745ae303c44f75908d901e43dc4f9d894cbb9f16" + }, + "rtl/ssc/ssc_tms7000_alu.sv": { + "sha256": "1389c648ca6f345b0537fbf3f99cfddd06568e12a7cdf8cf9309418ba131136e", + "qualified_input_sha256": "6a3325f23ce8ed07db617020b801ad3e8f253c8808fac22910e7d1fcd4d36967" + }, + "rtl/ssc/ssc_tms7000_bcd.sv": { + "sha256": "1b220b6c1f61a59009a7aabc166af1e6a8095029f6acb2b4e6681f0cb663106d", + "qualified_input_sha256": "159341006bd37e4df433d8b4ccc5f37a7bad0e5b886c18509969d41b3d298d4d" + }, + "rtl/ssc/ssc_tms7000_decode.sv": { + "sha256": "a3f5cc75814e7ad974653d39cbc19bf1bbf04f6d049a9fac310fc7fc91bf8484", + "qualified_input_sha256": "e814cc04dd1abd9c244547b8ab911f3f1eec850b48fb7825df980a46a63ef8fe" + }, + "rtl/ssc/ssc_tms7000_defs.vh": { + "sha256": "96ce2894dfaf8cfbc1f382606bca5db89b3907ea12c99effb81656c0cbb0a171", + "qualified_input_sha256": "5d5c3f3aa966ccc859c7b4caa5b74a397018f316f67897618acb2b8a602d1799" + }, + "rtl/ssc/ssc_tms7000_exec.sv": { + "sha256": "366046cea5874d3c82ade20d453a9e40a300d3735715afbcdb23a1a34dc1b2df", + "qualified_input_sha256": "d943769cbc71a9e1fb784e77b4efb145a4755e89c598168048da230bd6e1dd87" + }, + "rtl/ssc/ssc_tms7000_io.sv": { + "sha256": "14cf030b8337a7e4c3d6a96bf0f9ea0789c45dba6df9b7124e2d9e581b6f234f", + "qualified_input_sha256": "e600cb83e32ce2f15122b03e8348eac5d4702f0af01863b316f39f617f3c35b0" + }, + "rtl/ssc/ssc_tms7000_memory.sv": { + "sha256": "87e05cef8baa70eba9a43aa721e507b1becba8c975123cbc147cd0b548d105b0", + "qualified_input_sha256": "82f721b3612890eee013096f5ab5b4329aa4c7ab7ac708b11d7f4d1aa1149463" + }, + "rtl/ssc/ssc_tms7000_pacer.sv": { + "sha256": "44a57567298ba1ac8807a65c2a117f4a6f43f34574fcfeb6da9c121847091d61", + "qualified_input_sha256": "639a8b89b7349c312361adcf25c4261bbda4475bb0bc7e25c10dbc8d2f49325f" + }, + "rtl/wd1793.sv": { + "sha256": "31ca50b27294edbcc617958bf315341e40ba61438711382b5a320252b8d949e8", + "qualified_input_sha256": "31ca50b27294edbcc617958bf315341e40ba61438711382b5a320252b8d949e8" + }, + "sys/alsa.sv": { + "sha256": "74943b658cd3f4adc5b74c72f225fb42b95122a1c5e453df860a4c6a9bf72fc9", + "qualified_input_sha256": "74943b658cd3f4adc5b74c72f225fb42b95122a1c5e453df860a4c6a9bf72fc9" + }, + "sys/arcade_video.v": { + "sha256": "ce64cdd7f900ded7b9cd9aa728dab7383b7561cdc75dfe82ab23fe27a3d217d3", + "qualified_input_sha256": "ce64cdd7f900ded7b9cd9aa728dab7383b7561cdc75dfe82ab23fe27a3d217d3" + }, + "sys/ascal.vhd": { + "sha256": "3f74c7b52d749cf523b11cbd06a9269f831ad86967ee983b4a0d1f5792b645f6", + "qualified_input_sha256": "3f74c7b52d749cf523b11cbd06a9269f831ad86967ee983b4a0d1f5792b645f6" + }, + "sys/audio_out.v": { + "sha256": "565dd9badb00052dbd324e70f7ab66e8c6ecd0c5c2791aebffe477a2c0669363", + "qualified_input_sha256": "565dd9badb00052dbd324e70f7ab66e8c6ecd0c5c2791aebffe477a2c0669363" + }, + "sys/build_id.tcl": { + "sha256": "09d23b2a31bc1e04a3b9d4a8632d777eac9b10893b3a3f38b7f18f6fcc41ebee", + "qualified_input_sha256": "09d23b2a31bc1e04a3b9d4a8632d777eac9b10893b3a3f38b7f18f6fcc41ebee" + }, + "sys/ddr_svc.sv": { + "sha256": "8dfa874b9a93b4dbbe3b2fcf4f9035a895262cc090d398f4099941a626f41c08", + "qualified_input_sha256": "8dfa874b9a93b4dbbe3b2fcf4f9035a895262cc090d398f4099941a626f41c08" + }, + "sys/f2sdram_safe_terminator.sv": { + "sha256": "400bcbcfc0b4aae324fe813866a5443d577bf4de9b4ab1454cb068733d170261", + "qualified_input_sha256": "400bcbcfc0b4aae324fe813866a5443d577bf4de9b4ab1454cb068733d170261" + }, + "sys/gamma_corr.sv": { + "sha256": "2754944c6fe05d921374d1fecc26621782520b3bc6fbf600ca561e9f37c7af88", + "qualified_input_sha256": "2754944c6fe05d921374d1fecc26621782520b3bc6fbf600ca561e9f37c7af88" + }, + "sys/hps_io.sv": { + "sha256": "1182da0710483a1030687c12e6601025a5293ab90f2eb15cdf5fdea38ea4c275", + "qualified_input_sha256": "1182da0710483a1030687c12e6601025a5293ab90f2eb15cdf5fdea38ea4c275" + }, + "sys/hq2x.sv": { + "sha256": "2146b69cf63c26a4b41407e9ac1b4462db4d7e3ea6d8a99f31ba12712d68f975", + "qualified_input_sha256": "2146b69cf63c26a4b41407e9ac1b4462db4d7e3ea6d8a99f31ba12712d68f975" + }, + "sys/i2c.v": { + "sha256": "f41fea50a4cc3341b84b797e5383de070fafb08b31c94936eff51f9f6223c6bc", + "qualified_input_sha256": "e91b70c56ed68bb946276c7728178842fded6295e57ef81b7bd9e76f8efc6a48" + }, + "sys/i2s.v": { + "sha256": "927d2aea6797fb837f383e5e8a3259609e132ed24883127240ab21601f467efa", + "qualified_input_sha256": "927d2aea6797fb837f383e5e8a3259609e132ed24883127240ab21601f467efa" + }, + "sys/iir_filter.v": { + "sha256": "570a8095c15af84a60015b5eab105cee6e2d7edde77e20f0ce40c075ab2db8b7", + "qualified_input_sha256": "570a8095c15af84a60015b5eab105cee6e2d7edde77e20f0ce40c075ab2db8b7" + }, + "sys/ltc2308.sv": { + "sha256": "825fa1197c8e9f31c19c2fef1b01693133fb7df3cfb2dd831f2848a98fc6899c", + "qualified_input_sha256": "825fa1197c8e9f31c19c2fef1b01693133fb7df3cfb2dd831f2848a98fc6899c" + }, + "sys/math.sv": { + "sha256": "d384fa9fcf73100cb28a2affc5db1e4aacc87620287971c3882507fc3af056cc", + "qualified_input_sha256": "d384fa9fcf73100cb28a2affc5db1e4aacc87620287971c3882507fc3af056cc" + }, + "sys/mcp23009.sv": { + "sha256": "b112bd5f422457913b691613994fcd4afa70940aa3fde93e5674fa76d50e34ce", + "qualified_input_sha256": "95a505f01647b2b06a7cd755c1390032b1b72fc571c041c7861fc10196af153b" + }, + "sys/mt32pi.sv": { + "sha256": "4ad39571d16a4b25347030d75ffdf601803ddec71e2e3fcabe962103cc45a1a2", + "qualified_input_sha256": "4ad39571d16a4b25347030d75ffdf601803ddec71e2e3fcabe962103cc45a1a2" + }, + "sys/osd.v": { + "sha256": "68ec08401a6ddaf68c95a2e976b9085b77f0002d5b64ffed7454055dbcc48062", + "qualified_input_sha256": "68ec08401a6ddaf68c95a2e976b9085b77f0002d5b64ffed7454055dbcc48062" + }, + "sys/pll.13.qip": { + "sha256": "f25f58e7c0290583f33ee0fdd729a4470cc69312686f0f1ecb95c61115d61cec", + "qualified_input_sha256": "f25f58e7c0290583f33ee0fdd729a4470cc69312686f0f1ecb95c61115d61cec" + }, + "sys/pll_audio.13.qip": { + "sha256": "60edce734c54e4b9f9d56f078bc797841e52c6817f4d27e0cfe77db5d77b2596", + "qualified_input_sha256": "60edce734c54e4b9f9d56f078bc797841e52c6817f4d27e0cfe77db5d77b2596" + }, + "sys/pll_audio.qip": { + "sha256": "278496eefe70d18f6b3ccf624c3a4595ccca74a9a6740eb4520200f1e929a236", + "qualified_input_sha256": "278496eefe70d18f6b3ccf624c3a4595ccca74a9a6740eb4520200f1e929a236" + }, + "sys/pll_audio.v": { + "sha256": "1662fff7650cd443db81db7f0707f5583d223372b3e3c41af2d41ea4f3ac38f3", + "qualified_input_sha256": "1662fff7650cd443db81db7f0707f5583d223372b3e3c41af2d41ea4f3ac38f3" + }, + "sys/pll_audio/pll_audio_0002.qip": { + "sha256": "4cedd5394006286e0be61acdcbb6455f35cdf5c1488f4eb4a76b60e20eb43fb8", + "qualified_input_sha256": "4cedd5394006286e0be61acdcbb6455f35cdf5c1488f4eb4a76b60e20eb43fb8" + }, + "sys/pll_audio/pll_audio_0002.v": { + "sha256": "2b24d2a561d81cc8b20f725884ee9c243e619058e42ebcdcf6f491d33008696c", + "qualified_input_sha256": "2b24d2a561d81cc8b20f725884ee9c243e619058e42ebcdcf6f491d33008696c" + }, + "sys/pll_cfg.qip": { + "sha256": "7c1573f321012132479272242434d02058b1bcfe8d89843130ef11173a901eae", + "qualified_input_sha256": "7c1573f321012132479272242434d02058b1bcfe8d89843130ef11173a901eae" + }, + "sys/pll_cfg.v": { + "sha256": "e07ae93193537830b3bc9029465e763a6bfe354c25b7e7747eeeb4094b08ad10", + "qualified_input_sha256": "e07ae93193537830b3bc9029465e763a6bfe354c25b7e7747eeeb4094b08ad10" + }, + "sys/pll_cfg/altera_pll_reconfig_core.v": { + "sha256": "9058d2c68e9cb0b1b6b3ab5487daad8aeaf04461e162aba317857dd133329189", + "qualified_input_sha256": "9058d2c68e9cb0b1b6b3ab5487daad8aeaf04461e162aba317857dd133329189" + }, + "sys/pll_cfg/altera_pll_reconfig_top.v": { + "sha256": "34c11c19e6bf3797d2db2e41314ce802f5a01041265ce943b54e7f20eb2027c9", + "qualified_input_sha256": "34c11c19e6bf3797d2db2e41314ce802f5a01041265ce943b54e7f20eb2027c9" + }, + "sys/pll_cfg/pll_cfg.v": { + "sha256": "89750669762947128e105736d82384587f1cf8ac2f9965090e483c20f7624d59", + "qualified_input_sha256": "89750669762947128e105736d82384587f1cf8ac2f9965090e483c20f7624d59" + }, + "sys/pll_cfg/pll_cfg_hdmi.v": { + "sha256": "d3874dda124af03656054fa1ae1ee70f1a4d3cea6d4670795a5168325bb6760a", + "qualified_input_sha256": "d3874dda124af03656054fa1ae1ee70f1a4d3cea6d4670795a5168325bb6760a" + }, + "sys/pll_cfg_hdmi.v": { + "sha256": "e139f13dcd4cad01bb2ae1cdade7e608508bf973f79b0190bb6e833c06472650", + "qualified_input_sha256": "e139f13dcd4cad01bb2ae1cdade7e608508bf973f79b0190bb6e833c06472650" + }, + "sys/pll_hdmi.13.qip": { + "sha256": "625df824716313233400454bc1142615fb3a234a494225691c8a554753b1731b", + "qualified_input_sha256": "625df824716313233400454bc1142615fb3a234a494225691c8a554753b1731b" + }, + "sys/pll_hdmi.qip": { + "sha256": "5571604010bf98858a0797a2286d2389e105d32a97b42508865b02ba4237dd0d", + "qualified_input_sha256": "5571604010bf98858a0797a2286d2389e105d32a97b42508865b02ba4237dd0d" + }, + "sys/pll_hdmi.v": { + "sha256": "499561547c1045a46f1137558e2bab83d8e026e5d32669b5c5779a264b7ed676", + "qualified_input_sha256": "499561547c1045a46f1137558e2bab83d8e026e5d32669b5c5779a264b7ed676" + }, + "sys/pll_hdmi/pll_hdmi_0002.qip": { + "sha256": "de648286a832ee72839dd6abb444231a4238d32b2c26f29426399d2221d7bf5b", + "qualified_input_sha256": "de648286a832ee72839dd6abb444231a4238d32b2c26f29426399d2221d7bf5b" + }, + "sys/pll_hdmi/pll_hdmi_0002.v": { + "sha256": "27c77f35c89e97994477801f83edf3c7e9c5b9e57df49864434d300c40e9f1f7", + "qualified_input_sha256": "27c77f35c89e97994477801f83edf3c7e9c5b9e57df49864434d300c40e9f1f7" + }, + "sys/pll_hdmi_adj.vhd": { + "sha256": "ae18c82eef2f6b9c7783c68ac272d03f570eb1bdaddce14a1908c351da51a71b", + "qualified_input_sha256": "ae18c82eef2f6b9c7783c68ac272d03f570eb1bdaddce14a1908c351da51a71b" + }, + "sys/pll_q13.qip": { + "sha256": "c2b9c95a49d9b1100b0640bbdeea1acff845b0a8cbc11a7259c0913d2c61cfa8", + "qualified_input_sha256": "c2b9c95a49d9b1100b0640bbdeea1acff845b0a8cbc11a7259c0913d2c61cfa8" + }, + "sys/pll_q17.qip": { + "sha256": "7139faf33ae28066e805f290b15401eddb092d4b7d31b529a3ce1f0213fbc90a", + "qualified_input_sha256": "7139faf33ae28066e805f290b15401eddb092d4b7d31b529a3ce1f0213fbc90a" + }, + "sys/scandoubler.v": { + "sha256": "d36181c5fde9df0a504c547e23f60bcf201420052ada2682f081b00fd9485e6b", + "qualified_input_sha256": "d36181c5fde9df0a504c547e23f60bcf201420052ada2682f081b00fd9485e6b" + }, + "sys/scanlines.v": { + "sha256": "1fc7ac5359fd224a3fc06388f7671e07bf57cf6a39f35803a265661c56c564d4", + "qualified_input_sha256": "1fc7ac5359fd224a3fc06388f7671e07bf57cf6a39f35803a265661c56c564d4" + }, + "sys/sd_card.sv": { + "sha256": "25114f9a0e9ab4dd702633ae927fc825dc79a4d9f7746c1bb75dbd10d61eb6d6", + "qualified_input_sha256": "25114f9a0e9ab4dd702633ae927fc825dc79a4d9f7746c1bb75dbd10d61eb6d6" + }, + "sys/shadowmask.sv": { + "sha256": "88429d137b4ce9f6538a052f03d874604f46decf6d69b3fc824cc795efcf3193", + "qualified_input_sha256": "88429d137b4ce9f6538a052f03d874604f46decf6d69b3fc824cc795efcf3193" + }, + "sys/sigma_delta_dac.v": { + "sha256": "352d31dd185bce14d9d1e8a4999fbb5f2b5b2e42b048bdc9f4b828119cc5127a", + "qualified_input_sha256": "352d31dd185bce14d9d1e8a4999fbb5f2b5b2e42b048bdc9f4b828119cc5127a" + }, + "sys/spdif.v": { + "sha256": "a617bba332c4611caf81ba585b8f6828c7899aec5f81664a870f10419cb9b451", + "qualified_input_sha256": "a617bba332c4611caf81ba585b8f6828c7899aec5f81664a870f10419cb9b451" + }, + "sys/sys.qip": { + "sha256": "3854d7f172097e01a40037e0a82dfd1a4178391ea0964767492979216279f31d", + "qualified_input_sha256": "3854d7f172097e01a40037e0a82dfd1a4178391ea0964767492979216279f31d" + }, + "sys/sys.tcl": { + "sha256": "e9ab2b7c89b4347854810387550a65458aa3ec9de1bd26ad74328d73376f6a88", + "qualified_input_sha256": "e9ab2b7c89b4347854810387550a65458aa3ec9de1bd26ad74328d73376f6a88" + }, + "sys/sys_analog.tcl": { + "sha256": "e4cbfd22985fa046b546c0cfc626fccf773d9098b7c6a595f8bea66d67d25203", + "qualified_input_sha256": "e4cbfd22985fa046b546c0cfc626fccf773d9098b7c6a595f8bea66d67d25203" + }, + "sys/sys_dual_sdram.tcl": { + "sha256": "4f41376069b2070079d8ba4ae4a722c8ecfe3ca4b99798d0bdd8cda986b5ad5b", + "qualified_input_sha256": "4f41376069b2070079d8ba4ae4a722c8ecfe3ca4b99798d0bdd8cda986b5ad5b" + }, + "sys/sys_top.sdc": { + "sha256": "0a5fa4015b82ad7ce38e56d1ae4aadea6209af59c5dd9eff56a11139cf16ce86", + "qualified_input_sha256": "0a5fa4015b82ad7ce38e56d1ae4aadea6209af59c5dd9eff56a11139cf16ce86" + }, + "sys/sys_top.v": { + "sha256": "1bc7cc0ad6f8d03b9933f576cb8e2537f68aa335e79871bbc2380b8d0c9b0938", + "qualified_input_sha256": "1bc7cc0ad6f8d03b9933f576cb8e2537f68aa335e79871bbc2380b8d0c9b0938" + }, + "sys/sysmem.sv": { + "sha256": "9f8cf78563cc31beb7dfc6d7048c51ba536ff4f1f9f640b4ff9f8d574456c94e", + "qualified_input_sha256": "9f8cf78563cc31beb7dfc6d7048c51ba536ff4f1f9f640b4ff9f8d574456c94e" + }, + "sys/vga_out.sv": { + "sha256": "02a533c3dfd547afddea2946019ecc79bbe9c27bb6128c0999fa5fc9e78f8108", + "qualified_input_sha256": "02a533c3dfd547afddea2946019ecc79bbe9c27bb6128c0999fa5fc9e78f8108" + }, + "sys/video_cleaner.sv": { + "sha256": "44b986d9bf8412e56bf8e4eae3dc87e04b4c378e58ec6119de5a8aed320e3572", + "qualified_input_sha256": "44b986d9bf8412e56bf8e4eae3dc87e04b4c378e58ec6119de5a8aed320e3572" + }, + "sys/video_freak.sv": { + "sha256": "6a9b8565f66894a8f2ec10c916593e980d260f29f1886bfe70bf6f3b0cf6edc0", + "qualified_input_sha256": "6a9b8565f66894a8f2ec10c916593e980d260f29f1886bfe70bf6f3b0cf6edc0" + }, + "sys/video_freezer.sv": { + "sha256": "0f3f4710b072b7e90b0b6bfe7607dec18dbd6bed78d1994f32d6fa72a6b7aef3", + "qualified_input_sha256": "0f3f4710b072b7e90b0b6bfe7607dec18dbd6bed78d1994f32d6fa72a6b7aef3" + }, + "sys/video_mixer.sv": { + "sha256": "31ed2c917bd6680b4d60328e71a4f28015bd5fcec21e15b290eacec88971167d", + "qualified_input_sha256": "31ed2c917bd6680b4d60328e71a4f28015bd5fcec21e15b290eacec88971167d" + }, + "sys/yc_out.sv": { + "sha256": "c52d7bfcc8dbc5a0cda2b3117172cbba790fb97b7de61722ddac205f6ec8bc20", + "qualified_input_sha256": "c52d7bfcc8dbc5a0cda2b3117172cbba790fb97b7de61722ddac205f6ec8bc20" + }, + "uart-reset.sdc": { + "sha256": "15ecd89405d0e384ad0eba8954e3f4585583942f55238c34f3b98eb2e4934943", + "qualified_input_sha256": "350a23355e72b79223a87800b4df219ec4ca562fddc127c9d737afbb945ead93" + } + }, + "comment_rewrites": { + "rtl/ssc/ssc_ay8913.sv": "Project description comment only; implementation unchanged", + "rtl/ssc/ssc_glue.sv": "Project description comment only; implementation unchanged", + "rtl/ssc/ssc_host.sv": "Project description comment only; implementation unchanged" + }, + "public_release_changes_after_import": "Visible core identity Coco 3 Plus; explicit contribution copyright notices. Profile remains coco3plus through native MGL." +} diff --git a/validation/standalone.json b/validation/standalone.json new file mode 100644 index 0000000..7cddbaa --- /dev/null +++ b/validation/standalone.json @@ -0,0 +1,2240 @@ +{ + "date_utc": "2026-11-18T22:54:14.226474+00:00", + "upstream_base": "8b8cf72d1fb4de1d05345de8d5b92ec2d500fcd2", + "build_source_state": "Consolidated working source before its single implementation commit; exact input hashes below", + "display_identity": "Coco 3 Plus", + "profile_identity": "coco3plus", + "quartus": "Quartus Prime Shell\r\nVersion 17.0.2 Build 602 07/19/2017 SJ Lite Edition\r\nCopyright (C) 2017 Intel Corporation. All rights reserved.", + "seed": 5, + "elapsed": "00:14:33", + "errors": 0, + "warnings": 73, + "rbf_bytes": 3946736, + "rbf_sha256": "768ee9db2923bf7b7acf7f57473c6c56f92d14ffc6d6bd88719148f80c9a2d42", + "minimum_slack_ns": { + "Setup": 0.089, + "Hold": 0.212, + "Recovery": 0.691, + "Removal": 0.701, + "Minimum": 0.396 + }, + "build_input_sha256": { + "AMW.stp": "59799b5d57c9657ef6b2028999bea2cb794953a3fe3c68b2dc3fce75368d0813", + "COCO3_Comp.xlsx": "938d7504986d35669bd20857c7c29dcafa538a9cfed3cc70595b06d1893004e2", + "CoCo3.qpf": "44babfe2642e6f7a566ae773481bacc83aa59343cc7d49237592f3f525f5bbc6", + "CoCo3.qsf": "267d2b49871f975595493fe3afc35497997651397d62954ee2ee5d56cabfb834", + "CoCo3.srf": "49989d3f5b93bba318e096f04e717c5a2be68f42fb14ee37c10d460255b62bf7", + "CoCo3.sv": "3862fa092512f355038d3ac6bd8c01aa895da0310e2b721d25d555b4c76175ab", + "CoCo3FPGA.sdc": "7a0602fa0a15da3a2be98291ed2a04752b3ec8d256db8bd33718aa138b01866c", + "HD.stp": "c29540dbcc56deaa91bd4a838759cf9462250b2cd225cf551f4acf2598422f1a", + "HD2.stp": "b29d028394d5260a31a1ee59b1b595b951dd5201bdb12dd470674a2cee3a2681", + "Serial.stp": "e5ffa5dfc5d3496ccb7227cbbdb42c5e78a849a3933c5a8ea5c56746068b1ded", + "Video1.stp": "e94f9baae2ee75cd419494b385546876b7a3633c5f2c61b5ac51bec182804f03", + "Video_Explorer.stp": "66fde5d09c3c54054726b6cd4c5c5e44ddd199cbf418484081d86d02fc4017d6", + "Video_Explorer2.stp": "b125d02059c7871a068b3b0128dc2e6f075bc0c5c666e91eb4fe108445b12983", + "Vsync.stp": "51e8856a42caaa2652efec0afaa9521ab0047d77a7d28f473e5b1c0936fd5386", + "build_id_num.v": "83a1d8652f3307af5b693d8569d6929c8ea08e3a88b82176e658e67a6d2954eb", + "docs/Boot.vhd": "9bc0f35dc6f57cc3623146d20f817ac92da24f00d1441f0bf40700753ee323a1", + "docs/CoCo3FPGA.docx": "f5be57bedeb58de620f4cd8914d1c466a38e326fbad138cb033d96afa8fe1d0d", + "docs/CoCo3FPGA.pdf": "71c47607d12125c5486dad7d1d4ede7dc9a28389ba6216fa237b4ee69f32193a", + "docs/~$Co3FPGA.docx": "99f30a3eeb8e6c9dc78fded13fedbf750beb536f80d6ef82b16362cee6b92d9b", + "external-io.sdc": "67694509f8bb3323008de762076781f9ac542a493ecfc59292073983446d3278", + "files.qip": "ad042eb6fb28f1443f1af562be264e80552e5d47fae37553e849db18936fd51a", + "pll.xml": "fcaa430f0aa361bc4a4c8f9bf9f524b31bf0c8915330821fc843120f08e33d9c", + "releases/CoCo3_20211221.rbf": "2b11bffe31cc6b18b7b0d3099d445f4d624848ba7c0ba919f614c072fb15ef96", + "releases/CoCo3_20211229.rbf": "bf68e13febc5dd9319a7c5ba955eb8309578c8cd96ea952eea7a96853d376859", + "releases/CoCo3_20220124.rbf": "09be803a776f1baaba948dd62678e5edd4107d6d274200e49e76dcd3e32e5729", + "releases/CoCo3_20220211.rbf": "ddc50b452885f4440227da1c8e87b017cc007ee7048a29315235a31038fc5794", + "releases/CoCo3_20220219.rbf": "429aaf5ad6f7c5f8467c9551d76651a79840daf6292ce9e93a576ed48097c574", + "releases/CoCo3_20220226.rbf": "89422a751fcbcd604140ceec9db0a1f89fa67d28188caaecea773856c3c82082", + "releases/CoCo3_20230224.rbf": "872792ba23727478f79dad545703b46a89cfd2d3a741ca0aa3d8240e5e6305a5", + "releases/CoCo3_20231023.rbf": "daf8d0645722ffdb46594ba2996b96aa53b4c9a270782fc9c3bfff6f26e1ac17", + "releases/CoCo3_20240205.rbf": "817dcb4c6e95d1f2ce1e1f3a2e4e8e70c2ec9fcb1f497b20f0fcb8dea6dff8b6", + "releases/CoCo3_20240318.rbf": "1eb57f5c3c2dd42a24d4a6cff6aa77004e3627bc005f268949f9b6720e437e20", + "releases/CoCo3_20240514.rbf": "a6d23c62f6d1e12608f567a9da4997e99b1d22fb838f29e09e56dab8774bd845", + "releases/CoCo3_20260927.rbf": "1f73c6628b5b78a7efe8cfe3a7bb60fb05d7dc9f9f4d3e95771ee4464ecb44e3", + "releases/Tandy CoCo3 Overview.pdf": "249cace4054292cc84bd26e2f533f73cf554e6f148db9b58b8c60a6c5910eadb", + "reset-cpu.sdc": "87dac9d08fb26243cf8b90249b5ad8547590796241d2cfc94b688114318925e7", + "reset.stp": "1a9450490d28af0915d7e1ff2606cfdf2b22f1bddb64a4bac175d242720c5217", + "rom_Exploror.stp1": "c5bf08a6bf6cf5fc51341d56ba61a0cf99a984e63138d2dfab47dcc58e1a72bb", + "rtl/AMW.v": "748ee9fb6d8b7bde1c9f4f6b619a06eb6e5858b9f46e641236d32e1798089fa0", + "rtl/Auto_Run.sv": "ad57906fb7adf5685f8f3078f7355741386bb3cc014df2f62147ad46d12f1466", + "rtl/CPU09/6809Data.pdf": "f5fc61a75bad046277f6faeb8b25abb123a0ceeb7470b369b89310451b12d756", + "rtl/CPU09/cpu09_119.vhd": "6bc7971aeed4b8a75bc0035e71efb472d17e6bd248202ce7a15cf3c9df317fce", + "rtl/CPU09/cpu09_122.vhd": "4ec882cc35b344cd3aa15e90a1167f15d6e8966ea5c7c80c467f830f9ea1ebb7", + "rtl/CPU09/cpu09l_126.vhd": "c1a4569d8326b7ecb5fc0bbb6138593eb4ce3aa35453bc246e28062713fd4d14", + "rtl/CPU09/cpu09l_126x.vhd": "4b0f881053f367938ef6da574ec4e1ae7d5a35b6080d1ef3b77c8ec21577c37d", + "rtl/CPU09/cpu09l_127.vhd": "b4f88758cadcd57fdb626ad42a7558a23da732f8f0a580e1c92b4c5c9b0d80bf", + "rtl/CPU09/cpu09l_128.vhd": "f49ed673a2d6580d093c2cba8e11eb19306dac1d77a3eac9580402a4f4bcca31", + "rtl/CPU09/cpu09l_128a.vhd": "fbbb24ceabd32a98e9ebb9f303c841faf4a7c2e699709dafba952c4fc85eac45", + "rtl/CPU09/cpu09new_B15.vhd": "880190fe7684c9139d62b6dc7d84c5816bb9a40a2523fd7511a7b320baeb9f8a", + "rtl/Cassette_Write.sv": "f335e44c6827aca2f8756fdf4c090b9136ed625a217847e8f953701c11f367c1", + "rtl/CoCo3FPGA.sdc": "98dd3b41bf28ae3555f8fe3e13e36d156ef35093115cf08e2bda236dc81620e8", + "rtl/EE_Cold_Bt.v": "53265384140471177152839224e80ce9dea3a58aeca077fd493183aa8250dd8f", + "rtl/Mister_Video.v": "83500e27d8e50d19580bf337b088064a569ad4e0b536123c421b9cf2593a4878", + "rtl/OVO.vhd": "15e3d48657cf461fe3c17d5c2a26001248d4ad12d5ae015c3dd8ca19679165b9", + "rtl/PS2_Key/ps2_keyboard.v": "6eec7c87a77cd1adefa41323afb8d3384fc20e83cfc7e5c15df316ee0c5aeebe", + "rtl/UART_6551/6551rx.v": "fb68c3c4b99970209ec6c389329901d53bc34e317c99d9cb79dda7d3ed0ccad7", + "rtl/UART_6551/6551tx.v": "025c9117bf47ce60875cc7c3ec9f32bcfc0dab9af1d448b89e06705be7396bbf", + "rtl/UART_6551/uart_6551.v": "72a04083920a24736181d157a1ffdaf1581369efb0e41a65365bfe1e9dfa2bd8", + "rtl/VDAC.mif": "e195a39cbd63e4045c319770b1724bf74d076dfd39ea4a76824f00178e7ebf80", + "rtl/VDAC.qip": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "rtl/VDAC.v": "8fee8b34d709472748b2102ab94ab30b5d621a1f9ed5f8d0744c2199c148ea8c", + "rtl/bh_mpi_config.sv": "cb42863dad207370ccba35e41c2e6018fabd801d6b68b877f5a9031abf0569db", + "rtl/bh_mpi_rom.sv": "dad86cec0f5a92ed522015b85d928337776cf3ad91ec7362d487334831fdc382", + "rtl/bh_mpi_router.sv": "5ec1810afa4fe1b362605955be476968967ca791a38a9bd2bb01c246897ec2c4", + "rtl/cassette.v": "83e741835c3d90c9a4ec573593c1ec05bad86fae22d680ea047e3d5b64adda5e", + "rtl/coco3fpga.sv": "39be81ca39760850b0d44c7a2af15225ccbc24d3bea6a75eaa40f58d1d75a7e0", + "rtl/coco_mem_fetch.sv": "d9d871ec0ff12eaee889888a5876f320417f96b572b2ca16153f1007e568ee71", + "rtl/cocokey.v": "37c14e7e48fd7d74bbee6abe530ba45c554f73ca6fb9bdeb70f46dfa4fe55bb6", + "rtl/config.sv": "8a2a74e0c8d58410432f365b96dd5cf5bb54d877627997b6b919131f7821fdf4", + "rtl/cpu_sdram_bridge.sv": "2ac82076548ea235ed5d1c9ef438ae7452f190aecab31a29bc650c8d84ed875d", + "rtl/fdc.sv": "ea3076a0752b4674b4394c93f12a109237fdbe86737956bccec85e737e11110e", + "rtl/mc6809glb/mc6809glb.v": "29c84e1bf316fdd5a1a8b7a0343569a30e4b8ea0e4809e6fa1f6d4bd899ca00e", + "rtl/pll.ppf": "d8deb975a2d5826c460c5f6446860dfe85babd23905d42e2a5c2e77a08433dbd", + "rtl/pll.qip": "70215fd33c10af64df666f32faed94ab4d3c145b997c414dcb30342cf37f184c", + "rtl/pll.sip": "e675771bdb4b484889c1518a1b94ddd62a887e63e1f7d693742dab4ee2be5f8c", + "rtl/pll.spd": "b6c257356adbd72ca3bafecfcd19a9fc949be025ce81b9952307a8389f6a7b2f", + "rtl/pll.v": "58c479233d7baf971f7f2532dc145775e08e8c8c3956ab8681563aad7e09ecfe", + "rtl/pll/pll_0002.qip": "87733565096fce9f034019ca43b32dcb6b2c2413999fccd3d5dcf3e3191652d2", + "rtl/pll/pll_0002.v": "38b4a07902f5602361e1b923a0c9cd3271976b375e2cc17137e9f3b3f29c3938", + "rtl/ps2_mouse.v": "60f0f8cc82cd41728a2e0414d54058934a33d7b80309840e6461676457d2689c", + "rtl/rom/coco3_char_rom.vhd": "83735477cdad66a1549f45401c6651c75271f81f880b54eef2bba94502555707", + "rtl/rom/coco_rom_16.vhd": "0e39fdc3a2fe1938c23a7146ed04a35cc13a44ba39bd1c29bebb3132412fae90", + "rtl/rom/coco_rom_32K.vhd": "219d07d8d81da38178b3b2f39387b96619420098805a7a8866cbff7bbc969271", + "rtl/rom/coco_rom_8K.vhd": "5e90985003715c029235bb41e8bb6bfc0abc3bc77239fae4a77c947f5bcafeb1", + "rtl/rom/coco_rom_cart.vhd": "dd7675b06f908a97d39cb7ca973fb8be050e37d01097d206e8142762af9ff908", + "rtl/rtc.sv": "e1816ac2a250aad5417a6c007f819dc00bdff6c531c90fb13e86906e79cefc8a", + "rtl/sdc.sv": "5aa768daa6af438f7aadfa3fd247a3b09fc7787a3e805a9ae26690bb23e17f68", + "rtl/sdc_top.sv": "df869df91f59d84a044140cf048d5605632f0bcd0078049790854acc50d433ce", + "rtl/sdram/sdram2.sv": "43ff3eb494b4d65b83467a9426ab1a7d9208e96e3bac4a21f4ef4b9faeac5e59", + "rtl/square_gen.v": "908ebcfe32865780d15499078e717b39e19ebe1c3f8315bcbab1418387924d5e", + "rtl/sram/coco_ram.vhd": "8f61548abaf74d08462370f75b826e498be123cb5b453952894d63c65906d596", + "rtl/sram/coco_vid_ram_buf.vhd": "d977d473ea0d773ccb7aee81ed4202f9976ba5854ea3ae0189432cbfe99f9be3", + "rtl/ssc/LICENSE": "204dd45efd32cbf07d425b03bb19e9e9da48d32036fe2b5ceb81d56ed502dc71", + "rtl/ssc/ssc_audio.sv": "1e368e0eb6a4f58ca29d0c0b69352b52709dc58cae548549da8f9377aaf3caa8", + "rtl/ssc/ssc_ay8913.sv": "a21fbded914d3d2a5eb8b4b080f5140d0018116335860c976aea6d11da8e7a5f", + "rtl/ssc/ssc_cartridge.sv": "50df91d332f19f6d4ad302f9dc6774052f58a075bd13c6d3835f4e4993b0d4c3", + "rtl/ssc/ssc_glue.sv": "f91f20146447bde4f938110460845bbc055fbe258f47517e430050a6de890994", + "rtl/ssc/ssc_host.sv": "a92a2d9ad6df056d7a15eb89c9fe8199090c02422b6313c4a6d55b218a27f7bd", + "rtl/ssc/ssc_mister_bridge.sv": "0986a4e97bf7887f48f076a5b0f4a19981f69103bf11d0083f9a1c7c882557d1", + "rtl/ssc/ssc_sp0256.sv": "43e045008d6aa8f867e5c9fd800666ab531e194c6cde6d936a1669b8e5d148c2", + "rtl/ssc/ssc_sp0256_memory.sv": "68d2da460a216741ec6c2119202761a3eaaf4e6ad92362698f4915495a9bdc05", + "rtl/ssc/ssc_sp0256_tables.vh": "4cd641a20916208c776ee57478f5ead9e16ceecab770f1c357972fb14496daec", + "rtl/ssc/ssc_tms7000.sv": "88910f452e10b9b07521d81e7ee1803da80ead98d8d988a78d6d933a221e2928", + "rtl/ssc/ssc_tms7000_alu.sv": "1389c648ca6f345b0537fbf3f99cfddd06568e12a7cdf8cf9309418ba131136e", + "rtl/ssc/ssc_tms7000_bcd.sv": "1b220b6c1f61a59009a7aabc166af1e6a8095029f6acb2b4e6681f0cb663106d", + "rtl/ssc/ssc_tms7000_decode.sv": "a3f5cc75814e7ad974653d39cbc19bf1bbf04f6d049a9fac310fc7fc91bf8484", + "rtl/ssc/ssc_tms7000_defs.vh": "96ce2894dfaf8cfbc1f382606bca5db89b3907ea12c99effb81656c0cbb0a171", + "rtl/ssc/ssc_tms7000_exec.sv": "366046cea5874d3c82ade20d453a9e40a300d3735715afbcdb23a1a34dc1b2df", + "rtl/ssc/ssc_tms7000_io.sv": "14cf030b8337a7e4c3d6a96bf0f9ea0789c45dba6df9b7124e2d9e581b6f234f", + "rtl/ssc/ssc_tms7000_memory.sv": "87e05cef8baa70eba9a43aa721e507b1becba8c975123cbc147cd0b548d105b0", + "rtl/ssc/ssc_tms7000_pacer.sv": "44a57567298ba1ac8807a65c2a117f4a6f43f34574fcfeb6da9c121847091d61", + "rtl/wd1793.sv": "31ca50b27294edbcc617958bf315341e40ba61438711382b5a320252b8d949e8", + "sys/alsa.sv": "74943b658cd3f4adc5b74c72f225fb42b95122a1c5e453df860a4c6a9bf72fc9", + "sys/arcade_video.v": "ce64cdd7f900ded7b9cd9aa728dab7383b7561cdc75dfe82ab23fe27a3d217d3", + "sys/ascal.vhd": "3f74c7b52d749cf523b11cbd06a9269f831ad86967ee983b4a0d1f5792b645f6", + "sys/audio_out.v": "565dd9badb00052dbd324e70f7ab66e8c6ecd0c5c2791aebffe477a2c0669363", + "sys/build_id.tcl": "09d23b2a31bc1e04a3b9d4a8632d777eac9b10893b3a3f38b7f18f6fcc41ebee", + "sys/ddr_svc.sv": "8dfa874b9a93b4dbbe3b2fcf4f9035a895262cc090d398f4099941a626f41c08", + "sys/f2sdram_safe_terminator.sv": "400bcbcfc0b4aae324fe813866a5443d577bf4de9b4ab1454cb068733d170261", + "sys/gamma_corr.sv": "2754944c6fe05d921374d1fecc26621782520b3bc6fbf600ca561e9f37c7af88", + "sys/hps_io.sv": "1182da0710483a1030687c12e6601025a5293ab90f2eb15cdf5fdea38ea4c275", + "sys/hq2x.sv": "2146b69cf63c26a4b41407e9ac1b4462db4d7e3ea6d8a99f31ba12712d68f975", + "sys/i2c.v": "f41fea50a4cc3341b84b797e5383de070fafb08b31c94936eff51f9f6223c6bc", + "sys/i2s.v": "927d2aea6797fb837f383e5e8a3259609e132ed24883127240ab21601f467efa", + "sys/iir_filter.v": "570a8095c15af84a60015b5eab105cee6e2d7edde77e20f0ce40c075ab2db8b7", + "sys/ltc2308.sv": "825fa1197c8e9f31c19c2fef1b01693133fb7df3cfb2dd831f2848a98fc6899c", + "sys/math.sv": "d384fa9fcf73100cb28a2affc5db1e4aacc87620287971c3882507fc3af056cc", + "sys/mcp23009.sv": "b112bd5f422457913b691613994fcd4afa70940aa3fde93e5674fa76d50e34ce", + "sys/mt32pi.sv": "4ad39571d16a4b25347030d75ffdf601803ddec71e2e3fcabe962103cc45a1a2", + "sys/osd.v": "68ec08401a6ddaf68c95a2e976b9085b77f0002d5b64ffed7454055dbcc48062", + "sys/pll.13.qip": "f25f58e7c0290583f33ee0fdd729a4470cc69312686f0f1ecb95c61115d61cec", + "sys/pll_audio.13.qip": "60edce734c54e4b9f9d56f078bc797841e52c6817f4d27e0cfe77db5d77b2596", + "sys/pll_audio.qip": "278496eefe70d18f6b3ccf624c3a4595ccca74a9a6740eb4520200f1e929a236", + "sys/pll_audio.v": "1662fff7650cd443db81db7f0707f5583d223372b3e3c41af2d41ea4f3ac38f3", + "sys/pll_audio/pll_audio_0002.qip": "4cedd5394006286e0be61acdcbb6455f35cdf5c1488f4eb4a76b60e20eb43fb8", + "sys/pll_audio/pll_audio_0002.v": "2b24d2a561d81cc8b20f725884ee9c243e619058e42ebcdcf6f491d33008696c", + "sys/pll_cfg.qip": "7c1573f321012132479272242434d02058b1bcfe8d89843130ef11173a901eae", + "sys/pll_cfg.v": "e07ae93193537830b3bc9029465e763a6bfe354c25b7e7747eeeb4094b08ad10", + "sys/pll_cfg/altera_pll_reconfig_core.v": "9058d2c68e9cb0b1b6b3ab5487daad8aeaf04461e162aba317857dd133329189", + "sys/pll_cfg/altera_pll_reconfig_top.v": "34c11c19e6bf3797d2db2e41314ce802f5a01041265ce943b54e7f20eb2027c9", + "sys/pll_cfg/pll_cfg.v": "89750669762947128e105736d82384587f1cf8ac2f9965090e483c20f7624d59", + "sys/pll_cfg/pll_cfg_hdmi.v": "d3874dda124af03656054fa1ae1ee70f1a4d3cea6d4670795a5168325bb6760a", + "sys/pll_cfg_hdmi.v": "e139f13dcd4cad01bb2ae1cdade7e608508bf973f79b0190bb6e833c06472650", + "sys/pll_hdmi.13.qip": "625df824716313233400454bc1142615fb3a234a494225691c8a554753b1731b", + "sys/pll_hdmi.qip": "5571604010bf98858a0797a2286d2389e105d32a97b42508865b02ba4237dd0d", + "sys/pll_hdmi.v": "499561547c1045a46f1137558e2bab83d8e026e5d32669b5c5779a264b7ed676", + "sys/pll_hdmi/pll_hdmi_0002.qip": "de648286a832ee72839dd6abb444231a4238d32b2c26f29426399d2221d7bf5b", + "sys/pll_hdmi/pll_hdmi_0002.v": "27c77f35c89e97994477801f83edf3c7e9c5b9e57df49864434d300c40e9f1f7", + "sys/pll_hdmi_adj.vhd": "ae18c82eef2f6b9c7783c68ac272d03f570eb1bdaddce14a1908c351da51a71b", + "sys/pll_q13.qip": "c2b9c95a49d9b1100b0640bbdeea1acff845b0a8cbc11a7259c0913d2c61cfa8", + "sys/pll_q17.qip": "7139faf33ae28066e805f290b15401eddb092d4b7d31b529a3ce1f0213fbc90a", + "sys/scandoubler.v": "d36181c5fde9df0a504c547e23f60bcf201420052ada2682f081b00fd9485e6b", + "sys/scanlines.v": "1fc7ac5359fd224a3fc06388f7671e07bf57cf6a39f35803a265661c56c564d4", + "sys/sd_card.sv": "25114f9a0e9ab4dd702633ae927fc825dc79a4d9f7746c1bb75dbd10d61eb6d6", + "sys/shadowmask.sv": "88429d137b4ce9f6538a052f03d874604f46decf6d69b3fc824cc795efcf3193", + "sys/sigma_delta_dac.v": "352d31dd185bce14d9d1e8a4999fbb5f2b5b2e42b048bdc9f4b828119cc5127a", + "sys/spdif.v": "a617bba332c4611caf81ba585b8f6828c7899aec5f81664a870f10419cb9b451", + "sys/sys.qip": "3854d7f172097e01a40037e0a82dfd1a4178391ea0964767492979216279f31d", + "sys/sys.tcl": "e9ab2b7c89b4347854810387550a65458aa3ec9de1bd26ad74328d73376f6a88", + "sys/sys_analog.tcl": "e4cbfd22985fa046b546c0cfc626fccf773d9098b7c6a595f8bea66d67d25203", + "sys/sys_dual_sdram.tcl": "4f41376069b2070079d8ba4ae4a722c8ecfe3ca4b99798d0bdd8cda986b5ad5b", + "sys/sys_top.sdc": "0a5fa4015b82ad7ce38e56d1ae4aadea6209af59c5dd9eff56a11139cf16ce86", + "sys/sys_top.v": "1bc7cc0ad6f8d03b9933f576cb8e2537f68aa335e79871bbc2380b8d0c9b0938", + "sys/sysmem.sv": "9f8cf78563cc31beb7dfc6d7048c51ba536ff4f1f9f640b4ff9f8d574456c94e", + "sys/vga_out.sv": "02a533c3dfd547afddea2946019ecc79bbe9c27bb6128c0999fa5fc9e78f8108", + "sys/video_cleaner.sv": "44b986d9bf8412e56bf8e4eae3dc87e04b4c378e58ec6119de5a8aed320e3572", + "sys/video_freak.sv": "6a9b8565f66894a8f2ec10c916593e980d260f29f1886bfe70bf6f3b0cf6edc0", + "sys/video_freezer.sv": "0f3f4710b072b7e90b0b6bfe7607dec18dbd6bed78d1994f32d6fa72a6b7aef3", + "sys/video_mixer.sv": "31ed2c917bd6680b4d60328e71a4f28015bd5fcec21e15b290eacec88971167d", + "sys/yc_out.sv": "c52d7bfcc8dbc5a0cda2b3117172cbba790fb97b7de61722ddac205f6ec8bc20", + "uart-reset.sdc": "15ecd89405d0e384ad0eba8954e3f4585583942f55238c34f3b98eb2e4934943" + }, + "native_log_sha256": "9e4f7e3c2e096b9ddb183dabf49881795f7fd8a44076d63188c9bcbc8e1c2bce", + "summary_sha256": "a96f65ef379065b9bb928824a95e0fc2c2478ce8adfb882b8a4e2ddc5dd90f0e", + "reconstructed_roms": { + "source_url": "https://github.com/nitros9project/toolshed", + "source_revision": "3667a41c9605b7fcb150eace29cc7f42d460be1a", + "source_sha256": { + "Makefile": "4a29262fc1ba0b6106887425f5b0a4edb8ab81fd343af548cb3a863bda3aea51", + "bas.asm": "ca2e0fba27a1c960f56648ab7be6571a89a4aff6c433b9a2649924e308e8bf24", + "coco3.asm": "01147f426baf1b48fc6d590f18ca5974bedc3dfac486020e694d9f4b890d74f2", + "disk.asm": "735443637ebaddc358f6a12856c495cc92e08f3aaa8bb68cf9a0494d7655faae", + "equates.asm": "099d4ae145ee5151aa1eb7e9805388d338b2613fd53e2ba666ab757734d94442", + "extbas.asm": "75ce20734d0272f636a961b318fb898c555061194da12d9bfc26782fc4b5e42b", + "md5sums.txt": "f0374ad4bdd32f9cd322cfa5eafe04a0b27d2e90698b536aa26c00d1ea7c8eab", + "mugateerspic.asm": "2878b1a9fbf7cc3bde25475f5e256f25910fdb44b1b2f8e6f01883bcf13548a1" + }, + "assembler_sha256": "8b7ee402f7de3bf8552cdf8317f7d64d9b27af4b60f1cf7bbee76b6f31d35d4d", + "assembler_version": "lwasm from lwtools 4.25", + "commands": [ + [ + "--raw", + "-o", + "bas13.rom", + "equates.asm", + "bas.asm" + ], + [ + "--symbol-dump", + "--no-output", + "equates.asm", + "bas.asm" + ], + [ + "--raw", + "-o", + "extbas11.rom", + "cb_equates.asm", + "extbas.asm" + ], + [ + "--symbol-dump", + "--no-output", + "equates.asm", + "bas.asm", + "extbas.asm" + ], + [ + "--raw", + "--pragma=noindex0tonone", + "-o", + "disk11.rom", + "ecb_equates.asm", + "disk.asm" + ], + [ + "--raw", + "-o", + "coco3.rom", + "equates.asm", + "coco3.asm" + ] + ], + "roms": { + "bas13.rom": { + "bytes": 8192, + "sha256": "5375b1caef9df815b781d9cd6df81ecdaddd2642b06a01adac521e40f1329751" + }, + "coco3.rom": { + "bytes": 32768, + "sha256": "ad358430568250eb8330a37f85361d9ce67e5ae6d5a28c17b31802cd3953a5d2" + }, + "disk11.rom": { + "bytes": 8192, + "sha256": "1c40c5a74e72edaeecc2511fee1aab347eae2c3d5fc6778cb622e3df14d63157" + }, + "extbas11.rom": { + "bytes": 8192, + "sha256": "a18f270d3495d82b9f515de049f46253a623a2d9b1bb226c9ad338508344c5ee" + } + }, + "preassembled_inputs": false + }, + "functional_jobs": [ + { + "name": "audio-functional", + "exit_code": 0, + "seconds": 0.31 + }, + { + "name": "commands-functional", + "exit_code": 0, + "seconds": 0.77 + }, + { + "name": "delayed-functional", + "exit_code": 0, + "seconds": 17.09 + }, + { + "name": "i2c-functional", + "exit_code": 0, + "seconds": 7.52 + }, + { + "name": "keyboard-functional", + "exit_code": 0, + "seconds": 5.31 + }, + { + "name": "menu-functional", + "exit_code": 0, + "seconds": 3.22 + }, + { + "name": "mpi-core-functional", + "exit_code": 0, + "seconds": 9.08 + }, + { + "name": "mpi-functional", + "exit_code": 0, + "seconds": 12.64 + }, + { + "name": "peripheral-functional", + "exit_code": 0, + "seconds": 15.64 + }, + { + "name": "pixel-functional", + "exit_code": 0, + "seconds": 0.16 + }, + { + "name": "registered-functional", + "exit_code": 0, + "seconds": 67.32 + }, + { + "name": "reset-functional", + "exit_code": 0, + "seconds": 0.36 + }, + { + "name": "ssc-system-functional", + "exit_code": 0, + "seconds": 123.18 + }, + { + "name": "startup-functional", + "exit_code": 0, + "seconds": 1.53 + }, + { + "name": "video-functional", + "exit_code": 0, + "seconds": 5.44 + } + ], + "functional_log_sha256": { + "audio-functional": "44ace772c2f597c7b837115f196db29719e49a5ee7926d6c3899760c3a2091b6", + "commands-functional": "2acec082c88d3265039b76931d7c3c2120c562fc158521f65a638dbcfb605ef0", + "delayed-functional": "3bc1f653162badd7280466e80118c6d35f001d94e1c508de47ed35df648244c3", + "i2c-functional": "53ca504b9b4c2e46a2a7c5d2ce57cf9a2db009282e3253f35f36bb5ad963eff9", + "keyboard-functional": "7bab304cdb751340d71c76af09f792015e55275aa33640ff7422ab6a27692415", + "menu-functional": "feab6a60916a19adbc211188ed3e96035f843ca3d4fc3b89ee3d366fcc82d257", + "mpi-core-functional": "df77d6c159e890d14605f09f7f65d7a7445899816959dd8bea6f403d26e08744", + "mpi-functional": "7b3b1447fc5b36e1e9666479544eec8cd55658468dc28fee5b7bec3e4453f2f6", + "peripheral-functional": "f5b66970ed54113aa843b87f74aedd2a22158f8fe2a5d700113c681e6a220cd1", + "pixel-functional": "b4a9c4e1a1ea801de2a24b0588da8207c8bd714b4699ced0abf9d73f593343d1", + "registered-functional": "73a4c8bdc07024809cc28543bc9f0187f9ab65ff25abb08ea3df8a37ff38db16", + "reset-functional": "c1e490dddcdb3ecab95c37c7b035c063263550048bcecfde6514ed4ccf7db2b0", + "ssc-system-functional": "e79aa267def489752d8036fbfa35aa51b0113d8e188d35d241bdfefd4093ea0f", + "startup-functional": "b6915abae58e52f884651c2097f303ee9718e12c1aaafc152709e6e79892a6cc", + "video-functional": "0655f83bb88a5b75f7db2d65ad6df58a07288d7a7ec3f0f666168d011e0929f8" + }, + "timing": { + "bh_mpi_timing": { + "reports": { + "banks-from-fast-hold.rpt": { + "slack_ns": 1.195, + "sha256": "5de047fe2981e975dae3fa32f286bf5c99cc520febb403c40f25e9dda92b9c89" + }, + "banks-from-fast-setup.rpt": { + "slack_ns": 11.366, + "sha256": "404ad933da7ec2aad121f328b8ac823bf17c61c6bd2342a8c58b5b894ee39190" + }, + "banks-from-slow-hold.rpt": { + "slack_ns": 2.366, + "sha256": "7442e5ed93f791c4a3544d3f9bf806cdc59edd1ae9c8f50451f5e90d7abf6237" + }, + "banks-from-slow-setup.rpt": { + "slack_ns": 3.896, + "sha256": "0bdc37dd2bb585a20988de9ce568c196d32473e202a2a2557fa526368b3d58f7" + }, + "banks-to-fast-hold.rpt": { + "slack_ns": 0.544, + "sha256": "60829cc6395fe3ee6e67f8ea2ded68af67bd825a4612052f68fecfb379ae7d03" + }, + "banks-to-fast-setup.rpt": { + "slack_ns": 11.516, + "sha256": "ad8c824a486643ea0022326786152aeb76c297dc64d4092b747e52321fc5e9cb" + }, + "banks-to-slow-hold.rpt": { + "slack_ns": 1.143, + "sha256": "3e61380745fbe9c21857b194ea0891b226fc91db90948ca791f4f7eea2a47b08" + }, + "banks-to-slow-setup.rpt": { + "slack_ns": 4.54, + "sha256": "a12eb79645156530ec8e6278a0e2b50da3ec609f5be7eab179fee9310a1d5680" + }, + "config-from-fast-hold.rpt": { + "slack_ns": 0.171, + "sha256": "27eed46a060a9eefa52a9647e000148f17ece398a0daa97c8c383ee610a8a081" + }, + "config-from-fast-setup.rpt": { + "slack_ns": 5.424, + "sha256": "87fa5baec7f2bd2b63ca8681579f26c0c6d89867697dda066f3234e8ce322d4b" + }, + "config-from-slow-hold.rpt": { + "slack_ns": 0.461, + "sha256": "d4763db50fbb47fd29f04dfb6dbe9b64d3aebb97796c799b6a910086fd0a2015" + }, + "config-from-slow-setup.rpt": { + "slack_ns": 1.757, + "sha256": "ec46a10a83ee19a4e7b8c52a4388f54369888c3dbfbc967b69e86317e93f5c45" + }, + "config-to-fast-hold.rpt": { + "slack_ns": 0.171, + "sha256": "48ab28e134684fba2962488690cb559565206c3fc6a6605f16c0cf74c6d6ad3d" + }, + "config-to-fast-setup.rpt": { + "slack_ns": 10.385, + "sha256": "8b9abf5793ed0e9e129708406162412e710045597c00f9c95dc686b24b54a3bb" + }, + "config-to-slow-hold.rpt": { + "slack_ns": 0.461, + "sha256": "eac00078adc4931b424bac5ce7dacee8b8adb0b509b75247a223cd4927c138fd" + }, + "config-to-slow-setup.rpt": { + "slack_ns": 1.104, + "sha256": "e812b98b803c116e232993f4851d8308490a5a08cc44976d9650225aced97ffc" + }, + "global-fast-setup.rpt": { + "slack_ns": 0.61, + "sha256": "06f3cf435cd1b7fe967c5f87539b56f53dae285b6cc417d8d4b0873db09eeab1" + }, + "global-slow-setup.rpt": { + "slack_ns": 0.089, + "sha256": "b4aa1bdc246900981fedfb22583f09d6d97054b9326449053d418426e431d018" + }, + "restart-from-fast-hold.rpt": { + "slack_ns": 0.358, + "sha256": "5b7cddfd28f1fe352dccad54a53e515dcf9b78cf372a83812f35d1545ed09207" + }, + "restart-from-fast-setup.rpt": { + "slack_ns": 16.154, + "sha256": "60b43fdceb10bd9d90f61526e67ee1cfcaec9c39dbcb3662715832441a4ea739" + }, + "restart-from-slow-hold.rpt": { + "slack_ns": 0.679, + "sha256": "a71b208ac273fad3ec9c5428bd733862fbc96e0b85734081ed469775605bd236" + }, + "restart-from-slow-setup.rpt": { + "slack_ns": 14.334, + "sha256": "2bff7e610a96a906750bf7f563dac9a2fd0c214c63ea348752c671ed6876c929" + }, + "restart-to-fast-hold.rpt": { + "slack_ns": 0.667, + "sha256": "218b3a9c87ccf28e07793b040d788c323d022eda814bcf469aa065e3535625e7" + }, + "restart-to-fast-setup.rpt": { + "slack_ns": 5.399, + "sha256": "123c366f31d41eceddc7fff8241ef89a00501d101cd19895d1470097885bb18b" + }, + "restart-to-slow-hold.rpt": { + "slack_ns": 1.349, + "sha256": "71e576a301f01c53da834028024a69756c3c48cd5fc23c13a892646649b52c1e" + }, + "restart-to-slow-setup.rpt": { + "slack_ns": 1.969, + "sha256": "61b4982963c50af8ba0199ab7d65a0c05db6b4a86ce3593b076114694803d353" + }, + "rom-from-fast-hold.rpt": { + "slack_ns": 0.269, + "sha256": "9c5a6734d7169c04b4d4f8ba8a75c31fb950258350efb02845a0c41c0fff10b6" + }, + "rom-from-fast-setup.rpt": { + "slack_ns": 6.322, + "sha256": "aa5bf54586dd98978daacaf56b3e2f9769ec9774e43027b61679cdfd06158656" + }, + "rom-from-slow-hold.rpt": { + "slack_ns": 0.492, + "sha256": "bba19106499b9e7ee806947af20388a4aad192f879087dee1460183ab0008361" + }, + "rom-from-slow-setup.rpt": { + "slack_ns": 1.513, + "sha256": "c144560f7a44cb62e10ff1cca0b9bf80913225ca6a4b587a78ca7fc057840e54" + }, + "rom-to-fast-hold.rpt": { + "slack_ns": 0.269, + "sha256": "423c3ca8d2ab111c47a62d558fd9145b33ba7c119f8b6cf9fbba2e0d49690563" + }, + "rom-to-fast-setup.rpt": { + "slack_ns": 4.971, + "sha256": "5187fdc6daca241ab120b3fdc25df8c638115a8f456b974215fc27fad03e3077" + }, + "rom-to-slow-hold.rpt": { + "slack_ns": 0.492, + "sha256": "5f231d07f35ebb0d847c644d29f20e362474da3ff0f5102bb7cac47a1ca6f2ef" + }, + "rom-to-slow-setup.rpt": { + "slack_ns": 0.734, + "sha256": "ab8be45edafa4f5f28bde41c6da8fb32169e86738d860297bd25347238859439" + } + }, + "empty_synchronous_async_checks": [], + "log_sha256": "5b81591aad15bd26309bbafdc8e336f6aacf0e2ecc6ebb9a75aabf7181521853", + "script_sha256": "fcf877488563a76bd5d5deb67187055a3a5a9cc6b5f7ee2379c76f95ca7cc690" + }, + "nmi_timing_paths": { + "reports": { + "cpu-internal-fast-hold.rpt": { + "slack_ns": 0.324, + "sha256": "27854c55917a411b32ea59cfce04d49b5d9a5f2a75424c22879826fc31853068" + }, + "cpu-internal-fast-setup.rpt": { + "slack_ns": 11.479, + "sha256": "ef08bb3ddf6c1005817c747e4c1213fce6987cc5c984f31f02495026582c387a" + }, + "cpu-internal-slow-hold.rpt": { + "slack_ns": 0.583, + "sha256": "aab5b0b1a352527f8248fec3ba6047ec34b5840f539a6af156d19eb4f8461410" + }, + "cpu-internal-slow-setup.rpt": { + "slack_ns": 4.094, + "sha256": "fd8552e9f5c2d9b14109774b130c65acf289f3451077b28958a23e208c3b0534" + }, + "global-fast-hold.rpt": { + "slack_ns": 0.065, + "sha256": "8bd57420f081d2e631957d0314bbf6f179b930c0c75d4be48d4f140598678f95" + }, + "global-fast-recovery.rpt": { + "slack_ns": 3.054, + "sha256": "b384573634b0b29e598bfcd2a10fb7a192b7d3f29173972bdf56e4abc6f21d9f" + }, + "global-fast-removal.rpt": { + "slack_ns": 0.272, + "sha256": "e6796f8e4d773bfd49a857ac457aa7f8e29455a2ad9b9c3f157c2a923d92b1ac" + }, + "global-fast-setup.rpt": { + "slack_ns": 0.61, + "sha256": "99702fcc06eadc1219f31ced7e0b9753746a3676abd825fbcedad79872076c09" + }, + "global-slow-hold.rpt": { + "slack_ns": 0.212, + "sha256": "f32e4710c9f7260b68e9aa7336e7f7b220040724a5859ab5ff757b8f237e3503" + }, + "global-slow-recovery.rpt": { + "slack_ns": 0.691, + "sha256": "ce8c73d9fef5dd134950cc38394a1ca9da1fa785d89e07294f7f9eefcf118bf3" + }, + "global-slow-removal.rpt": { + "slack_ns": 0.701, + "sha256": "e0a5fc4ff08fb99d57d6a0cf237765842f9c342ef69d5ce7fca4b1db306eb0f7" + }, + "global-slow-setup.rpt": { + "slack_ns": 0.089, + "sha256": "f3441f361f5d7f4d8639aca165df777bad962896bed4c88f0a5892823f896225" + }, + "nmi-in-fast-hold.rpt": { + "slack_ns": 0.324, + "sha256": "46517b444d3cbcbb5371c0595d79be0442f1b1395a7872491960cc50a2db7567" + }, + "nmi-in-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "nmi-in-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "nmi-in-fast-setup.rpt": { + "slack_ns": 7.052, + "sha256": "fda67ad8b19f505773568a5cfc143c35065fea81d03ccc437b5ef9b96f51c565" + }, + "nmi-in-slow-hold.rpt": { + "slack_ns": 0.583, + "sha256": "1a05a04e64f4095964f9848bf938996802c34ce2172eb1a731f9be23329862ce" + }, + "nmi-in-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "nmi-in-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "nmi-in-slow-setup.rpt": { + "slack_ns": 5.477, + "sha256": "1a560c610ab2ebfd6b991f9e43c6cecfda166a002658fbe7ee24641a112eab3e" + }, + "nmi-out-fast-hold.rpt": { + "slack_ns": 0.327, + "sha256": "40c57075e1b6b3bf137959958cbb5c0ebacdf9c2190bd9c0036e6988c4e331e7" + }, + "nmi-out-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "nmi-out-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "nmi-out-fast-setup.rpt": { + "slack_ns": 11.479, + "sha256": "6a0285a5c61df5dc2648d36985eb4df258eb0a4569faa60ccfbaaf6530f4c54c" + }, + "nmi-out-slow-hold.rpt": { + "slack_ns": 0.62, + "sha256": "6629454456a7d8bc5c9d5e5deab7d7621a1e36c26483e48e3f724999f2e79fc0" + }, + "nmi-out-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "nmi-out-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "nmi-out-slow-setup.rpt": { + "slack_ns": 4.094, + "sha256": "334e6365286be616262b12d07bdb6238ee67c8999ed72fd08e002adee9499bf5" + }, + "nmi-through-NMILatched-fast-hold.rpt": { + "slack_ns": 0.444, + "sha256": "9a7d38e23314fc32e239a41b9242238b1aebedf1918c5547f75c15eed5586eab" + }, + "nmi-through-NMILatched-fast-setup.rpt": { + "slack_ns": 11.479, + "sha256": "c24020419a2b3464412d630103d0c049356e54b5db85871a352be24789b0cb54" + }, + "nmi-through-NMILatched-slow-hold.rpt": { + "slack_ns": 0.932, + "sha256": "53e7eb38b13a69e6ebc3496cfea70651e52ae06e81e853c2b761835b8af0f16f" + }, + "nmi-through-NMILatched-slow-setup.rpt": { + "slack_ns": 4.094, + "sha256": "5188b783146785b9988e1702df2fddfea006b478a2514ca1b7d07b0637f97945" + }, + "nmi-through-NMIMask-fast-hold.rpt": { + "slack_ns": 0.482, + "sha256": "330d59892d4773d0db6f8ac6d9a846770bf1ad8b30b4c24248a5484bc37f2881" + }, + "nmi-through-NMIMask-fast-setup.rpt": { + "slack_ns": 11.479, + "sha256": "356626928a755d5ee9faeb0e3e8979f059258290e9399dc1e0ec5adf9a6cfb00" + }, + "nmi-through-NMIMask-slow-hold.rpt": { + "slack_ns": 1.018, + "sha256": "0c129a76e83242d6e5b898e685dc564b5a69e0eb5aeed4f507f6156d482134f8" + }, + "nmi-through-NMIMask-slow-setup.rpt": { + "slack_ns": 4.094, + "sha256": "30d1112317ca2117d0bf08f6918a98fbc5280af09e54712ecde72f2a2992f356" + } + }, + "empty_synchronous_async_checks": [ + "nmi-in-fast-recovery.rpt", + "nmi-in-fast-removal.rpt", + "nmi-in-slow-recovery.rpt", + "nmi-in-slow-removal.rpt", + "nmi-out-fast-recovery.rpt", + "nmi-out-fast-removal.rpt", + "nmi-out-slow-recovery.rpt", + "nmi-out-slow-removal.rpt" + ], + "log_sha256": "964a48bb21f08cf61ad38b8eb43501b091532a0c2cce830ae3f953ccf6b45a67", + "script_sha256": "b7ad08df23e83f98773abe7c27c66dd97add20aeabffac8a1674382bf6e9c717" + }, + "uart_timing_paths": { + "reports": { + "global-fast-hold.rpt": { + "slack_ns": 0.065, + "sha256": "dcda0f844ba6a7e89672e2b27070e49f098b083f3f64562d2beb78609c652404" + }, + "global-fast-recovery.rpt": { + "slack_ns": 3.054, + "sha256": "7fade3768a5cce04f18fb2370de611e73d3b40e4b3494f5fc816b5c8880f89dd" + }, + "global-fast-removal.rpt": { + "slack_ns": 0.272, + "sha256": "003e1852ca20f75c2eec1149da542b7d90505fcab87de44698976a9b6f19a849" + }, + "global-fast-setup.rpt": { + "slack_ns": 0.61, + "sha256": "2e2411fcf7532930e20f21b923d1383d4ad16ba1c8730c7665d32fdec235894d" + }, + "global-slow-hold.rpt": { + "slack_ns": 0.212, + "sha256": "59e50c3addb7c8f549002cfcc0ef1c6717bf530d4f6829459688142efc9448e2" + }, + "global-slow-recovery.rpt": { + "slack_ns": 0.691, + "sha256": "a8949487c60626e73dfa714e83024fd34b8bbf6f2abf85d8f5034c8d88529bcd" + }, + "global-slow-removal.rpt": { + "slack_ns": 0.701, + "sha256": "27e6f248efdcbcbc3f257c8d9aabbcb0e9cee969322e11bd9c6b5b9da1a08344" + }, + "global-slow-setup.rpt": { + "slack_ns": 0.089, + "sha256": "d94f043283c6d75864397a24dbf9972e639c6506dd710b63ab1261b3ed431e9f" + }, + "uart-config-fast-hold.rpt": { + "slack_ns": 0.301, + "sha256": "7e8c48719862780a6f688fe74afe90684b9656fa41ac8d50b266a7ea056add60" + }, + "uart-config-fast-setup.rpt": { + "slack_ns": 6.977, + "sha256": "9cc7943bcd85eb56d7f33c2fc0f666bac438aca171745312ffb5ac73b7abf1e7" + }, + "uart-config-slow-hold.rpt": { + "slack_ns": 0.553, + "sha256": "224f6def769457d8900faeed4b4256ac2867a242d0232fc11578799cf9eb1fec" + }, + "uart-config-slow-setup.rpt": { + "slack_ns": 4.793, + "sha256": "384d96ac715f0452c8c88309f234902c57167f3116b242450212c20d04b3672b" + }, + "uart-fast-hold.rpt": { + "slack_ns": 0.166, + "sha256": "13cf5dac3e88313d7dff15cac3acc5f0390a36e6fc166d6eedb138382f0088fe" + }, + "uart-fast-recovery.rpt": { + "slack_ns": 7.296, + "sha256": "bf20b1704c8fe53b08968b1e3692fa675959a572fa8a24629b8dd18695c4a6b4" + }, + "uart-fast-removal.rpt": { + "slack_ns": 0.555, + "sha256": "cd0742e29448259a698b337a72a15c2f5d8c498ef61bd5ba015cd363410e9ea6" + }, + "uart-fast-setup.rpt": { + "slack_ns": 6.971, + "sha256": "b1f65b9cdadc6da6c8d3c8fe230237497cdc265ea82eaabddca09147a9fa48ca" + }, + "uart-out-fast-hold.rpt": { + "slack_ns": 0.166, + "sha256": "de3897abdee25f860749013ba213eccee5a54758e4012abf38e3a85101463197" + }, + "uart-out-fast-recovery.rpt": { + "slack_ns": 7.296, + "sha256": "9d8a18cf58682a920f264921cda36b16dfca5f879b861443c5e31c40ffa4d9b0" + }, + "uart-out-fast-removal.rpt": { + "slack_ns": 0.555, + "sha256": "f574062ba1f7ccec374a5e10b5717ce59f9aa05a25a134af58570ad3b0e09bca" + }, + "uart-out-fast-setup.rpt": { + "slack_ns": 6.971, + "sha256": "46cd8b5e833038594fb3447782aa4fac3ac0c6d46813ad6dcde085282d243ed6" + }, + "uart-out-slow-hold.rpt": { + "slack_ns": 0.348, + "sha256": "cd2d918fb38ccb0a83a8e10a4d4d6c214ca89b68368ff5907ba7c1948f2b0159" + }, + "uart-out-slow-recovery.rpt": { + "slack_ns": 5.672, + "sha256": "b29384e5427c617d5911b06bbad51d53d881a4a3804ebbf0ccdc952dada00fce" + }, + "uart-out-slow-removal.rpt": { + "slack_ns": 1.349, + "sha256": "c34efecbab32f2cce3953820db5112644a8eda79ade354184df82aa1bfd99314" + }, + "uart-out-slow-setup.rpt": { + "slack_ns": 2.495, + "sha256": "cc051214dc27d77114998ebc917d381cc12c19e45eb4a4297991650ed3d11761" + }, + "uart-slow-hold.rpt": { + "slack_ns": 0.348, + "sha256": "efcbe5a1c1ede01131dea621f17bad02cf8e7906edfbc9de8c0814c22aa53d98" + }, + "uart-slow-recovery.rpt": { + "slack_ns": 5.672, + "sha256": "912ccc7d217b4d9a912bced491b87c88e8aa3530a8e1e8b79e675f81086af3d1" + }, + "uart-slow-removal.rpt": { + "slack_ns": 1.349, + "sha256": "8e1f74daea0802b6bd5fe9ff3118e8a7c7c6137a02e066bb86e02fec012af7a7" + }, + "uart-slow-setup.rpt": { + "slack_ns": 2.621, + "sha256": "58fcf942b763debbbe44f2d17a0d93dee9c8cb1abbb2932e6cbefc19baf00d2f" + } + }, + "empty_synchronous_async_checks": [], + "log_sha256": "78202a6738298168c91441af1eb6095e52ecabc1adce60a445fb7f239f372dd3", + "script_sha256": "004268b1655afc9b060a96589ff552398b77284970d2804197476b21b2f1a543" + }, + "reset_cpu_timing_paths": { + "reports": { + "boot-fast-hold.rpt": { + "slack_ns": 0.17, + "sha256": "11339d082b87f5df4c5dca374d3d018f6dc2db4ed123669a97f3ad260702ca5a" + }, + "boot-fast-setup.rpt": { + "slack_ns": 7.511, + "sha256": "76a46a5b238a10583fc14bfc99fe24cd14b7dd89f3484b2d31cc466c89af9cc8" + }, + "boot-slow-hold.rpt": { + "slack_ns": 0.423, + "sha256": "893f04c44398035dba1df5f02f0ad234c2fcc64b6fa2dc41a2156163fcaf19a5" + }, + "boot-slow-setup.rpt": { + "slack_ns": 6.053, + "sha256": "4feff3ed4280cef9387322784fcc9bb3f7405a978acd529abb6a4888bff66d64" + }, + "bridge-in-fast-hold.rpt": { + "slack_ns": 0.321, + "sha256": "f42e57a6b08197ae3d3f2432ae545dc35e4ded3035da1d95f508bce1fa8492cc" + }, + "bridge-in-fast-setup.rpt": { + "slack_ns": 2.529, + "sha256": "68cb40ae68fe919d95b30b8d6b82d45a21dd40194e2068a318a4cdae32131b99" + }, + "bridge-in-slow-hold.rpt": { + "slack_ns": 0.444, + "sha256": "dbb32f9834c0dbf3c7bf89af6be0a52e3092ef1e04ea6802d213d0f29d53ca8a" + }, + "bridge-in-slow-setup.rpt": { + "slack_ns": 0.499, + "sha256": "267f45e551ed86508f443cf33051f32ab1a28d35d0e7be5799a708bf6b88d6f3" + }, + "bridge-out-fast-hold.rpt": { + "slack_ns": 0.274, + "sha256": "9cfa20c5017a04dfc6183ce578fd34e3ec70f8aa211ebf403c06ff1cec35bc0b" + }, + "bridge-out-fast-setup.rpt": { + "slack_ns": 2.577, + "sha256": "3240fa58107ab8c22ab8e58d7167bce7791eaaa3df4d546e5c9a252b741cd841" + }, + "bridge-out-slow-hold.rpt": { + "slack_ns": 0.58, + "sha256": "46f5be1ac20fa52da4e2a03c4699b17ee5ccac618fb63e6c11959fd17b08dbbc" + }, + "bridge-out-slow-setup.rpt": { + "slack_ns": 0.499, + "sha256": "cc05c66bba9f3ec81c017815bf497c0965a5457dc72373557002bd30a7b060ac" + }, + "control-in-fast-hold.rpt": { + "slack_ns": 0.208, + "sha256": "8aaf3d9861f638b0f55858682b392f60c0f87dd2c54bf420ddf8d9c530ec5a32" + }, + "control-in-fast-setup.rpt": { + "slack_ns": 2.509, + "sha256": "e84ceb47941877600c6f25fe6d78fd0cfa27e60d0933b9fd7a122de2aff9459a" + }, + "control-in-slow-hold.rpt": { + "slack_ns": 0.493, + "sha256": "121a94117d6046f71d0c947dbe82e2125524c2e13b11dab6ddd2923c0739d35f" + }, + "control-in-slow-setup.rpt": { + "slack_ns": 0.619, + "sha256": "1f5061c8ca5c5c8fe99287a406836ce8ec2cbf13ed9691f07e624b47f84c35f8" + }, + "control-out-fast-hold.rpt": { + "slack_ns": 0.208, + "sha256": "bb73b013a838c260c222590381bf7c47dc687af77c3f5908b097e1a5984b2deb" + }, + "control-out-fast-setup.rpt": { + "slack_ns": 2.509, + "sha256": "889b48173ee76a8ca5224bbb8e0677fa84978d32fd07e8d3e6ed3c283f97b04b" + }, + "control-out-slow-hold.rpt": { + "slack_ns": 0.483, + "sha256": "b29b9e68442f54641efdf8bd9324c412bf1090087434b6f2040cfda711b0609f" + }, + "control-out-slow-setup.rpt": { + "slack_ns": 0.619, + "sha256": "8993f0c962702a061087f6cff04459850f78c7eed44abbde2de08d40cd5d615d" + }, + "cpu-all-fast-hold.rpt": { + "slack_ns": 0.324, + "sha256": "74f38563190a0c8a0991bb51d7492be8524ebe065e77464f3c9a1d00f6fbbc23" + }, + "cpu-all-fast-setup.rpt": { + "slack_ns": 11.479, + "sha256": "e6df8b53f6a303259d42705300658cd9d02fe8826e3a25365769f3329b38abf1" + }, + "cpu-all-slow-hold.rpt": { + "slack_ns": 0.583, + "sha256": "56b0fe72b45daa550794558d64925af12e542d2bdabefddb4d8e8c8adc69963a" + }, + "cpu-all-slow-setup.rpt": { + "slack_ns": 4.094, + "sha256": "6871b678ec1f4e60040a40271104bd3e3a8477c7fda305818ce65478fc4e15be" + }, + "cpu-in-fast-hold.rpt": { + "slack_ns": 0.324, + "sha256": "183074b2b2e042566a6da6b5ecb708ff320cea4dec3b565821938acb8d8f0746" + }, + "cpu-in-fast-setup.rpt": { + "slack_ns": 7.041, + "sha256": "be7b829509878d63c4fff402029ae83a550e3de7145e8a84c90a4c08ed25d1dd" + }, + "cpu-in-slow-hold.rpt": { + "slack_ns": 0.495, + "sha256": "be1b580000d57b1fcbdd442b6bf5e51fde86f1ff12bec7a7c4d635a829b5402c" + }, + "cpu-in-slow-setup.rpt": { + "slack_ns": 0.778, + "sha256": "c4c2f0d19db0366a6f585db5c1fb44821677f4846c651dbf0ab4ab92053452f4" + }, + "cpu-out-fast-hold.rpt": { + "slack_ns": 0.324, + "sha256": "fff1b68d7cc2cbd8ee08005cb0048818b4f255fddba5122c94dc6142bdf0334f" + }, + "cpu-out-fast-setup.rpt": { + "slack_ns": 10.097, + "sha256": "a5c774ee2d08edcde775cea8e9a2248ccd31541d30f17d9a2bea335e97274448" + }, + "cpu-out-slow-hold.rpt": { + "slack_ns": 0.583, + "sha256": "52b5f1ddf43a74f101318b1a0b3da0372b7e1f41b7f357d1e08acd00f8700322" + }, + "cpu-out-slow-setup.rpt": { + "slack_ns": 1.225, + "sha256": "a29e8af247d839ccb87eb02f5fd082850c1c0c0c847f434f9719122ecfe81f85" + }, + "cpu-qualified-fast-hold.rpt": { + "slack_ns": 0.325, + "sha256": "28a1480f879f22feab82c109905604524715402ece5bf032981af640e223134f" + }, + "cpu-qualified-fast-setup.rpt": { + "slack_ns": 23.645, + "sha256": "dda0a4c7441a03abc40d0933a912d2d3c6663e15ee3c7e6d193b9e0f216bb6c5" + }, + "cpu-qualified-slow-hold.rpt": { + "slack_ns": 0.603, + "sha256": "405a34ce1bc61576a327688a711f6fb9940203bc8c825ba1792e505c1bb4b7d9" + }, + "cpu-qualified-slow-setup.rpt": { + "slack_ns": 10.484, + "sha256": "c7e4a59fb67e3a82dc51aee6b518945e28c4308a501e77057349dc2bc3330b22" + }, + "global-fast-hold.rpt": { + "slack_ns": 0.065, + "sha256": "bbf6413df4b52196bd3dd613509650cced949007fed17d7937326499aeb0fc92" + }, + "global-fast-recovery.rpt": { + "slack_ns": 3.054, + "sha256": "0de912385b661a1d91bda7cd89b01e8d54da45f633567a663b9bfbb6df5e7988" + }, + "global-fast-removal.rpt": { + "slack_ns": 0.272, + "sha256": "733ccccdba589cec03d7f8824a9881c2d5b79c424db7d88c1c5d16941408f9fa" + }, + "global-fast-setup.rpt": { + "slack_ns": 0.61, + "sha256": "77551fc3a7793ae00de15775d9de45b81840cd3ad06146113c5072f5a2ee5fb1" + }, + "global-slow-hold.rpt": { + "slack_ns": 0.212, + "sha256": "12f78c06e79a37f345c70a3329a154ac4586e8acb7870e831ffee4dc2503539e" + }, + "global-slow-recovery.rpt": { + "slack_ns": 0.691, + "sha256": "46ac5f9edd316b561220dcfc5a1c8a450c8d129656f1ab64869547bead915418" + }, + "global-slow-removal.rpt": { + "slack_ns": 0.701, + "sha256": "01513f607d673a3ea6e421cee37437dc651be3c0108077acb282544035915b0c" + }, + "global-slow-setup.rpt": { + "slack_ns": 0.089, + "sha256": "8d046b3b022be8225e42ec2da29bdd65312bd02b7cb298ef41a1140290362eaf" + }, + "per-clock-fast-setup.rpt": { + "slack_ns": 0.61, + "sha256": "3f40568dc745fb1702f70658a3b883f5ffd3cc177ab3c6a9e2ec4cc669535853" + }, + "per-clock-slow-setup.rpt": { + "slack_ns": 0.089, + "sha256": "eb98e0f9c635e5edd2cf4ee54dfd0d9a39d6d4155bc1902acc430e8395078d40" + }, + "reset-fast-hold.rpt": { + "slack_ns": 0.189, + "sha256": "9b852217dc63fa695c8a82b76c95428ea78a05aaeeef32799393bace85f652d0" + }, + "reset-fast-recovery.rpt": { + "slack_ns": 5.061, + "sha256": "2cef849fa3abb8fab9f6ebcdcd76ba08e34b5cf2de3d7fcc6af0752149402dab" + }, + "reset-fast-removal.rpt": { + "slack_ns": 0.312, + "sha256": "e3ab63aafb3ee26291979aea9602a766eed300aa15546b0f0235ed796c695143" + }, + "reset-fast-setup.rpt": { + "slack_ns": 5.433, + "sha256": "58584022082864497a22ac065a88e5e0a865d0e9cd1a1a6e864614e3e56f06c1" + }, + "reset-slow-hold.rpt": { + "slack_ns": 0.492, + "sha256": "3155a8b8a1842d8633c02af9b3c8470be7eb9f23eb033c80ea8ff7df88464a11" + }, + "reset-slow-recovery.rpt": { + "slack_ns": 0.691, + "sha256": "adb37651859a48cb3ce344fd2c0cf1411b13050038cb0d443388a2e3a594e99b" + }, + "reset-slow-removal.rpt": { + "slack_ns": 0.701, + "sha256": "a42044d86757198e4e3e079178d64635d16716f0b8be04bce14ca10178d2a854" + }, + "reset-slow-setup.rpt": { + "slack_ns": 2.106, + "sha256": "5c0cccadcc1989f259389cf21d291b002ff44a1d4855f557e94ced8206a14ea9" + } + }, + "empty_synchronous_async_checks": [], + "log_sha256": "3ccd4fce8bda1852461d1bc80e5586eead32651e7e6969af7c3cf8b0edb2b8b3", + "script_sha256": "8ac4ea0e160822043a1246b95f7a290a7a8ee8c15c29b7c17c8c734148ad703c" + }, + "video_timing_paths": { + "reports": { + "activation-fast-hold.rpt": { + "slack_ns": 0.174, + "sha256": "87fc195868e7a2e7aa2bf02d6e104e5a089027a2f53a82d5f8dc143edb5f4c37" + }, + "activation-fast-setup.rpt": { + "slack_ns": 5.594, + "sha256": "616be6c357428b99c621c2258cc92d67bf4c12dcf3addb914cbc2b2273e973ba" + }, + "activation-slow-hold.rpt": { + "slack_ns": 0.497, + "sha256": "89ecd5803422f57c7645a10bf12719427bed69c9ef48b35c3ccb4fa6c663d5ca" + }, + "activation-slow-setup.rpt": { + "slack_ns": 2.001, + "sha256": "597c77a548043c0a301618a2d2ff8dcf4d8ecaf03c8149213956f73033c5c72b" + }, + "address-fast-hold.rpt": { + "slack_ns": 0.18, + "sha256": "7782544bbbc370da682af6b0e04dfee27b2fbcb90079689255b08360dc7af86b" + }, + "address-fast-setup.rpt": { + "slack_ns": 5.665, + "sha256": "477a441c705478f4b18df37c4be28eae17fe2ab4e8d1cfd1d6c2e7cc8d927534" + }, + "address-slow-hold.rpt": { + "slack_ns": 0.649, + "sha256": "f15b27c17a5c6e2cbd027a40558d40f716b435b4cb58524cfc9609395850efa6" + }, + "address-slow-setup.rpt": { + "slack_ns": 1.771, + "sha256": "6cc6ef5c0bb43c39867d4896fbd2f63da027ae5ac9ac8e9b202be89a8840f59d" + }, + "controller-in-fast-hold.rpt": { + "slack_ns": 0.065, + "sha256": "8bb9c964c1f8ec06497bc4980f7061eb3c762ea1f28b075f4e6e6292b220a1cd" + }, + "controller-in-fast-setup.rpt": { + "slack_ns": 3.264, + "sha256": "ee205acd8d1ba73a5e7aed4b4e532cede67add4244349207ba6b3c5687634231" + }, + "controller-in-slow-hold.rpt": { + "slack_ns": 0.484, + "sha256": "0d1271813eac1b70a16e64b9b3d501fa904d6e4f703faaf7c052a1086cc2dd19" + }, + "controller-in-slow-setup.rpt": { + "slack_ns": 0.196, + "sha256": "9a6a2368e1fba115f03a2ec0d3205a77d37702f67619a23e12f855004eec2188" + }, + "controller-out-fast-hold.rpt": { + "slack_ns": 0.174, + "sha256": "b598c4ac68b5f7093cf82bbcd2a43e3a914a1a0d01afc735f51deb6491d425d4" + }, + "controller-out-fast-setup.rpt": { + "slack_ns": 2.003, + "sha256": "96e96e8d81e9c5c70746e30f030c97bc5cf487939497e2dd0d54cb8f6e901234" + }, + "controller-out-slow-hold.rpt": { + "slack_ns": 0.484, + "sha256": "a60f0d8ff51ff116857a47b56660cecdad24f8f815eaa358a970a18733fee703" + }, + "controller-out-slow-setup.rpt": { + "slack_ns": 1.201, + "sha256": "a1a755bc14ab212d683a74ae221b3311b6b33ad8fdd502da31ff9876526fa8f4" + }, + "fetch-in-fast-hold.rpt": { + "slack_ns": 0.167, + "sha256": "7b2b26c0fa383658f811b20a1f6d697c84a1e9f9436d1fb422a573fd9f4b09ac" + }, + "fetch-in-fast-setup.rpt": { + "slack_ns": 5.348, + "sha256": "64b64be7bcdf6e8776e0d7d8d6273ce81dc77c793dd395444c45c8c447b54982" + }, + "fetch-in-slow-hold.rpt": { + "slack_ns": 0.451, + "sha256": "8d88be9cba1e84f7b2dfd071a8f16aebdb39abb8d28be982f8ff8bae55a13e2f" + }, + "fetch-in-slow-setup.rpt": { + "slack_ns": 1.6, + "sha256": "97c8f355bec029ab0b139dfc066677f77a7b14ea5666b53595610494fe6e1957" + }, + "fetch-out-fast-hold.rpt": { + "slack_ns": 0.167, + "sha256": "930b88f55e92649120b2df6ee5e0e18f0cbbd62a9829985fb3d41f771b28c689" + }, + "fetch-out-fast-setup.rpt": { + "slack_ns": 6.52, + "sha256": "b30c69a4e0e5ee53b3198c1ae06b60caf624764bbb681f93c7aafe6009c7a17c" + }, + "fetch-out-slow-hold.rpt": { + "slack_ns": 0.451, + "sha256": "f2f16f6790627809599d855fb437381280cdb99675a670a3b73143fb4b45b7be" + }, + "fetch-out-slow-setup.rpt": { + "slack_ns": 4.118, + "sha256": "61f7db825edf57cbf5fa54fb09c10af6ccff6f68d9ca30abafbb86eef8be0601" + } + }, + "empty_synchronous_async_checks": [], + "log_sha256": "eade3faa85dcc5a29534f0d356ab747b4fd59186d492911df660733faaaa7aa9", + "script_sha256": "cc68d1180e85ec810618fd8ce7e4a6a556a4ece68db5351da36d66be8d1babb4" + }, + "ssc_integrated_timing": { + "reports": { + "audio-in-fast-hold.rpt": { + "slack_ns": 0.118, + "sha256": "ec11218ae7610c4b69919fceeb6bc9c87536562dee6c8c489166381b48e4ee0d" + }, + "audio-in-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "audio-in-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "audio-in-fast-setup.rpt": { + "slack_ns": 13.396, + "sha256": "acd672082a19acb4304e08c333d0baefc69cc53e6e52f8cdae84a84e5660198b" + }, + "audio-in-slow-hold.rpt": { + "slack_ns": 0.251, + "sha256": "1a1b8f2f6bb97b73c43156192c51d3232acffbe90c38a7831b853c66c585f132" + }, + "audio-in-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "audio-in-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "audio-in-slow-setup.rpt": { + "slack_ns": 9.32, + "sha256": "befa4efd5bcdef2f33ed083d688049d9e862916cf70d930da1d4e329b02708b0" + }, + "audio-out-fast-hold.rpt": { + "slack_ns": 0.118, + "sha256": "013fee01e4c88101e88b61f76f8881e218d727535170afcc751186b8705130c2" + }, + "audio-out-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "audio-out-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "audio-out-fast-setup.rpt": { + "slack_ns": 5.897, + "sha256": "577bf9b2322bda754cb9bf547346f91629a7a5d562a209d55fb883431b37d746" + }, + "audio-out-slow-hold.rpt": { + "slack_ns": 0.251, + "sha256": "41b2cc1e9413d0bc3be01a30f5c3308ff71182304e7125e17f54064e3bca29cb" + }, + "audio-out-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "audio-out-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "audio-out-slow-setup.rpt": { + "slack_ns": 2.757, + "sha256": "015cd90c354b1a3fd582db88f26bbabab9f1b1bdc3384124a986d619d2e27476" + }, + "ay-in-fast-hold.rpt": { + "slack_ns": 0.12, + "sha256": "4392edf87d5b35596051d6d2a7d77b18fddb5028708d99792df062b4b218c654" + }, + "ay-in-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "ay-in-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "ay-in-fast-setup.rpt": { + "slack_ns": 5.47, + "sha256": "e062583ca0397ead1916f8b62195e18cc2919ddeee27ef2019db6ec0d0e607eb" + }, + "ay-in-slow-hold.rpt": { + "slack_ns": 0.257, + "sha256": "341e4e4a9fef019f8791b56949a426d0326e147cbc43c6c123e95727b89b231b" + }, + "ay-in-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "ay-in-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "ay-in-slow-setup.rpt": { + "slack_ns": 1.7, + "sha256": "78536dcd5c8869c8b4510b7a87d9f8b705058fb7ed990d3f490cdf9ff7e276b7" + }, + "ay-out-fast-hold.rpt": { + "slack_ns": 0.12, + "sha256": "92ae2ea0ddbe294d167981820cd0471862cd57d6d1c1a4cb0fe11b8e879255c0" + }, + "ay-out-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "ay-out-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "ay-out-fast-setup.rpt": { + "slack_ns": 13.756, + "sha256": "1cd1d9103af43b71b0cc6d83e00aab1d06975fb3fda1ea56e39046e621a61061" + }, + "ay-out-slow-hold.rpt": { + "slack_ns": 0.257, + "sha256": "e40569bde24bb79340716d7ca381529746db4dd54d39579a308ac9bccee4bd26" + }, + "ay-out-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "ay-out-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "ay-out-slow-setup.rpt": { + "slack_ns": 8.699, + "sha256": "d9a588553cc9781f8575056584a639d5de39b1d23a267d325525d7b55eab9d2f" + }, + "bridge-in-fast-hold.rpt": { + "slack_ns": 0.172, + "sha256": "fcb1540ddcbc565e89785405a4531cbec8e2345c4615b2fad89732bb0eb1ac72" + }, + "bridge-in-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "bridge-in-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "bridge-in-fast-setup.rpt": { + "slack_ns": 5.567, + "sha256": "2705f34d892acb258321c4be5c6254a9fc44150a7b33e5ffcf8fdaf40e227ca7" + }, + "bridge-in-slow-hold.rpt": { + "slack_ns": 0.462, + "sha256": "acbd536791a7d7804e2307340abdbb748d4c013526962d8734f87e75e5704a3e" + }, + "bridge-in-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "bridge-in-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "bridge-in-slow-setup.rpt": { + "slack_ns": 2.343, + "sha256": "99ab45fce0aaf85e611dac1781c26b18f9198a7fbca6baef5b8eba67b3c9b6fa" + }, + "bridge-out-fast-hold.rpt": { + "slack_ns": 0.172, + "sha256": "0cb12bc0d9a62fc1d09b03f8afc9115ddeb2af6cee4dfd7ef0b0aaf8901189c6" + }, + "bridge-out-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "bridge-out-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "bridge-out-fast-setup.rpt": { + "slack_ns": 5.846, + "sha256": "82b6692d6b7e8d7b554237e938e9ed5dbfcae4663b4a4327a8b07470bf23de3d" + }, + "bridge-out-slow-hold.rpt": { + "slack_ns": 0.462, + "sha256": "d2f57ba55049bf710beb37a14b35ad253d094e84c82d7ef2d40a7b7397043f06" + }, + "bridge-out-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "bridge-out-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "bridge-out-slow-setup.rpt": { + "slack_ns": 2.25, + "sha256": "684194900890581c576bb57b44b8b16c91255f22694cc12ee153c09f74b2479c" + }, + "cartridge-in-fast-hold.rpt": { + "slack_ns": 0.118, + "sha256": "dd308585d1f2b727db5f3a573039cf009890222326097a33f1acbe2c01fc8b6a" + }, + "cartridge-in-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "cartridge-in-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "cartridge-in-fast-setup.rpt": { + "slack_ns": 5.47, + "sha256": "cf0fbde8ef09d57bfe6e75c8276233e82bc4985ceb6463c0c8d264d27882dd54" + }, + "cartridge-in-slow-hold.rpt": { + "slack_ns": 0.251, + "sha256": "692fdeae40595131d0d5eb0f3b2caab706bb54310c8a6f94a8f7dc825d2ef254" + }, + "cartridge-in-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "cartridge-in-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "cartridge-in-slow-setup.rpt": { + "slack_ns": 1.697, + "sha256": "da04e8e284ccb0d1e4e2f2be2385de4092be06bfed5d898c1a22150c9d06671a" + }, + "cartridge-out-fast-hold.rpt": { + "slack_ns": 0.118, + "sha256": "872e2c2668a4b20908ba619e66a58137a83e5b9e413a6a0ebe016329db3f5afa" + }, + "cartridge-out-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "cartridge-out-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "cartridge-out-fast-setup.rpt": { + "slack_ns": 5.897, + "sha256": "d0d0360aa0ac444cb49d113eb5c65902a9f04d08669dabf571e4b61195460702" + }, + "cartridge-out-slow-hold.rpt": { + "slack_ns": 0.251, + "sha256": "ac502fc2bc6d9adfa4069ed804d2fafcca2dc88401f1ba15faeb6cda7bb3a930" + }, + "cartridge-out-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "cartridge-out-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "cartridge-out-slow-setup.rpt": { + "slack_ns": 2.757, + "sha256": "cf7e90e8f75d3d51fef4b092c10b916777df99b4dedd58bf5bafa1566241e5a4" + }, + "controller-in-fast-hold.rpt": { + "slack_ns": 0.122, + "sha256": "a090a0afeadbbbac28f349b2706e414804bee36b1a84b5b55fc18d28baca74c8" + }, + "controller-in-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "controller-in-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "controller-in-fast-setup.rpt": { + "slack_ns": 6.272, + "sha256": "453c20dadea802b63aaa8daf30701888a6bb7ec6d42f2177a59a1d93d1462904" + }, + "controller-in-slow-hold.rpt": { + "slack_ns": 0.26, + "sha256": "58445d52fd5d30e430ade3cac7f957ecd7515179422be9fbbe49e350e768eab8" + }, + "controller-in-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "controller-in-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "controller-in-slow-setup.rpt": { + "slack_ns": 3.459, + "sha256": "77529be247ec2fbf9912aa507dddd382103daecce2645eaac3a4432322a35f39" + }, + "controller-out-fast-hold.rpt": { + "slack_ns": 0.122, + "sha256": "511efb56d30f8fe28fb2a3e2ae888124929b36fd27c3fb76ccb33ccb509e2dfd" + }, + "controller-out-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "controller-out-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "controller-out-fast-setup.rpt": { + "slack_ns": 5.929, + "sha256": "9c5c045917a737eae02188ab7cc6dca274142903fef13226dc00af4cda08cb8b" + }, + "controller-out-slow-hold.rpt": { + "slack_ns": 0.26, + "sha256": "d9ad29456e2461caba8f915444a523db2857b48606c3019c38370bdd46dc6214" + }, + "controller-out-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "controller-out-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "controller-out-slow-setup.rpt": { + "slack_ns": 2.978, + "sha256": "bb78b2020757fdccbeb817a5c5eb042c7ff73dd46b82513df862d6cc7aecad0d" + }, + "glue-in-fast-hold.rpt": { + "slack_ns": 0.174, + "sha256": "294069aa04376fe7893feacf0ce75ccaa8e125790faf3e06390cbbe34b5119c6" + }, + "glue-in-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "glue-in-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "glue-in-fast-setup.rpt": { + "slack_ns": 14.492, + "sha256": "e9b263fcef57f0aafd0c3ec00cb623b8e1cbfe683df03716fe4735eff1a58841" + }, + "glue-in-slow-hold.rpt": { + "slack_ns": 0.464, + "sha256": "5f1f7176cf3b8989daabdb00edc27b52c73c80792337f3f916e81145c82ea808" + }, + "glue-in-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "glue-in-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "glue-in-slow-setup.rpt": { + "slack_ns": 11.12, + "sha256": "5e689401cfc8beadc418b9aa998a4d42490366bf4e0c68106b09e0af9df0bca4" + }, + "glue-out-fast-hold.rpt": { + "slack_ns": 0.174, + "sha256": "aee24a7ced7397e0415fc969629517a6b4fcae1bd0faf1d2e495f7dae0183a98" + }, + "glue-out-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "glue-out-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "glue-out-fast-setup.rpt": { + "slack_ns": 7.412, + "sha256": "564d4f0c3c4a1175f5436df85e2107218e2d829db595edfa7c2787851b2fad4e" + }, + "glue-out-slow-hold.rpt": { + "slack_ns": 0.464, + "sha256": "c874c61bb9d9aeee263473afb1f1840e5e8636f35f45331f7bf3a3d13507356a" + }, + "glue-out-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "glue-out-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "glue-out-slow-setup.rpt": { + "slack_ns": 6.07, + "sha256": "c4d059d1d8d5bc6db7771f0b849f28d0e16bc0abb5039890cfba2e2cdfb83d7d" + }, + "host-in-fast-hold.rpt": { + "slack_ns": 0.171, + "sha256": "feb8b7420a2e7825154597642a16ea42ea49f7905c4fdc03a89bb3de3e9581bf" + }, + "host-in-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "host-in-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "host-in-fast-setup.rpt": { + "slack_ns": 5.722, + "sha256": "b302b6147e713ad4fe1a836864274f5c467be0e4ac749342f717c1282e54fb37" + }, + "host-in-slow-hold.rpt": { + "slack_ns": 0.461, + "sha256": "24d0a43c237bce93f6b830c648d2e6ff9f04264c64a48f460c9e71096d41f93b" + }, + "host-in-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "host-in-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "host-in-slow-setup.rpt": { + "slack_ns": 1.963, + "sha256": "b4d907ad603d4059bdc5a75542072056bf04191177b5e07dd7111a61c75657bd" + }, + "host-out-fast-hold.rpt": { + "slack_ns": 0.171, + "sha256": "b84f811e5a1b33e7a7d0d035ee7f5b5f538ff6484683dac5e311a1795cf5ec4f" + }, + "host-out-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "host-out-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "host-out-fast-setup.rpt": { + "slack_ns": 7.204, + "sha256": "ea0777c4c2c4f34b389998edebb4f95dd7a83f01b2315d4d1a73e99e2e9b2d3a" + }, + "host-out-slow-hold.rpt": { + "slack_ns": 0.461, + "sha256": "fd7b826ea5ec0bc89cc67944738f3654abf2a9079fe7249a5fdbf516a8c68ae9" + }, + "host-out-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "host-out-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "host-out-slow-setup.rpt": { + "slack_ns": 5.506, + "sha256": "12cde639f1081314c6d3b479dcfc478fe53c95302ab595712ff9c244102b9bd2" + }, + "power-in-fast-hold.rpt": { + "slack_ns": 1.157, + "sha256": "0fce84eae6c64b1f5d6f3a92700e07568c3308d577c214e50ae51837af303696" + }, + "power-in-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "power-in-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "power-in-fast-setup.rpt": { + "slack_ns": 14.964, + "sha256": "fcad3fd97e0a345057ae5f27cda1663c7957a9f694abafbba42a85963df43f3e" + }, + "power-in-slow-hold.rpt": { + "slack_ns": 2.269, + "sha256": "194d55264897beaabc2ca3e6e795e14c459ff40d899034687a73eb461cfead76" + }, + "power-in-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "power-in-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "power-in-slow-setup.rpt": { + "slack_ns": 12.73, + "sha256": "8f177fba032f040493c671b810c9d2fc55a1d62413034db601e634071e63566d" + }, + "power-out-fast-hold.rpt": { + "slack_ns": 0.4, + "sha256": "0471b45fcf05d69bdc16cdbef1f8d0c9a6d61b5f43322bf7b5da92c22f729fc1" + }, + "power-out-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "power-out-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "power-out-fast-setup.rpt": { + "slack_ns": 4.971, + "sha256": "979d57550e36ff8536496bec0e23ee93e48be5add3c2743cb10f2fdc8a39caa2" + }, + "power-out-slow-hold.rpt": { + "slack_ns": 0.898, + "sha256": "124eec11c5e4afd2c013dc75b2454c58104c9ba6bdf868d514c2bbb73c06244a" + }, + "power-out-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "power-out-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "power-out-slow-setup.rpt": { + "slack_ns": 0.734, + "sha256": "9fb8954815a8abcdf8bbac2ef8adc1d1f430628407aef2bb8985d2073de41799" + }, + "speech-in-fast-hold.rpt": { + "slack_ns": 0.124, + "sha256": "c28a11d4070606915bc1ccffcafb129fec1c1e2aae5d148dc4a09d664ab8ef5d" + }, + "speech-in-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "speech-in-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "speech-in-fast-setup.rpt": { + "slack_ns": 5.504, + "sha256": "c50f6488271ec0e677f270bc1c639def3ab532037e2424b67532edcc3beb6d9d" + }, + "speech-in-slow-hold.rpt": { + "slack_ns": 0.266, + "sha256": "87ebb1f779ec3cbca5f6e53efa8049cbc8a147da3491c7fc71923b5d62fc0e45" + }, + "speech-in-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "speech-in-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "speech-in-slow-setup.rpt": { + "slack_ns": 1.697, + "sha256": "33b151f2a962766aa5795d6c9689acef0ba15145e3ad5fbde6174dc6b0de67dd" + }, + "speech-out-fast-hold.rpt": { + "slack_ns": 0.124, + "sha256": "f16c0b55512f84d1ff64373a6d83ac0542ec73d1f9a887e4ac6e885f5b1de590" + }, + "speech-out-fast-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "speech-out-fast-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "speech-out-fast-setup.rpt": { + "slack_ns": 6.01, + "sha256": "e83a71f0e0ff24d5a7bab084a26d402585ea42a852163a7e92dbc80d9190c950" + }, + "speech-out-slow-hold.rpt": { + "slack_ns": 0.266, + "sha256": "cb580fa1593402321a601aacc71e6db48db63db1b70e8e86524c795919695498" + }, + "speech-out-slow-recovery.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "speech-out-slow-removal.rpt": { + "slack_ns": null, + "sha256": "c7c68a2725cde97a8333c886efa3dbc87510e9d62f2d9d0dd1d195a8be00afa0" + }, + "speech-out-slow-setup.rpt": { + "slack_ns": 3.107, + "sha256": "ca4f4debb7881caafd5e3a0508627873a10b1092c18ce2ce64b01963ec18ac01" + } + }, + "empty_synchronous_async_checks": [ + "audio-in-fast-recovery.rpt", + "audio-in-fast-removal.rpt", + "audio-in-slow-recovery.rpt", + "audio-in-slow-removal.rpt", + "audio-out-fast-recovery.rpt", + "audio-out-fast-removal.rpt", + "audio-out-slow-recovery.rpt", + "audio-out-slow-removal.rpt", + "ay-in-fast-recovery.rpt", + "ay-in-fast-removal.rpt", + "ay-in-slow-recovery.rpt", + "ay-in-slow-removal.rpt", + "ay-out-fast-recovery.rpt", + "ay-out-fast-removal.rpt", + "ay-out-slow-recovery.rpt", + "ay-out-slow-removal.rpt", + "bridge-in-fast-recovery.rpt", + "bridge-in-fast-removal.rpt", + "bridge-in-slow-recovery.rpt", + "bridge-in-slow-removal.rpt", + "bridge-out-fast-recovery.rpt", + "bridge-out-fast-removal.rpt", + "bridge-out-slow-recovery.rpt", + "bridge-out-slow-removal.rpt", + "cartridge-in-fast-recovery.rpt", + "cartridge-in-fast-removal.rpt", + "cartridge-in-slow-recovery.rpt", + "cartridge-in-slow-removal.rpt", + "cartridge-out-fast-recovery.rpt", + "cartridge-out-fast-removal.rpt", + "cartridge-out-slow-recovery.rpt", + "cartridge-out-slow-removal.rpt", + "controller-in-fast-recovery.rpt", + "controller-in-fast-removal.rpt", + "controller-in-slow-recovery.rpt", + "controller-in-slow-removal.rpt", + "controller-out-fast-recovery.rpt", + "controller-out-fast-removal.rpt", + "controller-out-slow-recovery.rpt", + "controller-out-slow-removal.rpt", + "glue-in-fast-recovery.rpt", + "glue-in-fast-removal.rpt", + "glue-in-slow-recovery.rpt", + "glue-in-slow-removal.rpt", + "glue-out-fast-recovery.rpt", + "glue-out-fast-removal.rpt", + "glue-out-slow-recovery.rpt", + "glue-out-slow-removal.rpt", + "host-in-fast-recovery.rpt", + "host-in-fast-removal.rpt", + "host-in-slow-recovery.rpt", + "host-in-slow-removal.rpt", + "host-out-fast-recovery.rpt", + "host-out-fast-removal.rpt", + "host-out-slow-recovery.rpt", + "host-out-slow-removal.rpt", + "power-in-fast-recovery.rpt", + "power-in-fast-removal.rpt", + "power-in-slow-recovery.rpt", + "power-in-slow-removal.rpt", + "power-out-fast-recovery.rpt", + "power-out-fast-removal.rpt", + "power-out-slow-recovery.rpt", + "power-out-slow-removal.rpt", + "speech-in-fast-recovery.rpt", + "speech-in-fast-removal.rpt", + "speech-in-slow-recovery.rpt", + "speech-in-slow-removal.rpt", + "speech-out-fast-recovery.rpt", + "speech-out-fast-removal.rpt", + "speech-out-slow-recovery.rpt", + "speech-out-slow-removal.rpt" + ], + "log_sha256": "89697eba7f9699cf3bb13fc4a5363d73ce45aac423e879feb6e4da248110e6ab", + "script_sha256": "52d8de4e547714e25f34cdf19f40293bb978172232af5c87eec32156013c3e94" + }, + "external_io_timing": { + "reports": { + "global-fast-hold.rpt": { + "slack_ns": 0.065, + "sha256": "113c2d64ca4cacccb27f0af5d7e1b26246cb5d290a46485e8d762f4b704af834" + }, + "global-fast-recovery.rpt": { + "slack_ns": 3.054, + "sha256": "fce629050b317f2c690896f71cc4f5688b46057a84aba347bbd2aa7cb83fd42c" + }, + "global-fast-removal.rpt": { + "slack_ns": 0.272, + "sha256": "140e3e71cd63113fa25fc97ba8f59202e3a39ede907054d61a6a246d4438eec7" + }, + "global-fast-setup.rpt": { + "slack_ns": 0.61, + "sha256": "d40c1c1338b5045cf8825fd27c3c5964d705497b7d4b0625b59e601a3d909306" + }, + "global-slow-hold.rpt": { + "slack_ns": 0.212, + "sha256": "92f6cca2345c9cbc05c24258ebd0339be18a847f49d7e818518048aa710e72c3" + }, + "global-slow-recovery.rpt": { + "slack_ns": 0.691, + "sha256": "5159203f86e0fc030014dbc59f8773c0104ac2f1bec3eb689041c0e2c3ab8569" + }, + "global-slow-removal.rpt": { + "slack_ns": 0.701, + "sha256": "e6fb4879a3e885874b7d170b1a2264198bb621f5714542747e57f71fb3bd526e" + }, + "global-slow-setup.rpt": { + "slack_ns": 0.089, + "sha256": "7d17d02d1ee563a83baa2b7bea73033c711ea2ba55bb7bf82e5d022620777ae9" + }, + "hdmi-direct-fast-hold.rpt": { + "slack_ns": 6.662, + "sha256": "b01cf733d99d5886b7bea12363b385ba8d4cc011d217e7c7ce91272b9ba20837" + }, + "hdmi-direct-fast-setup.rpt": { + "slack_ns": 5.994, + "sha256": "d3de3c90fc866b4ff45a98f8b2380648acac581eb538bcd91d9d5a31443b19f2" + }, + "hdmi-direct-slow-hold.rpt": { + "slack_ns": 6.326, + "sha256": "5cfc4997a50068b4a316ecd42afaa9f59bbd7ad8283ea70d97f1fe2b8c7f19bd" + }, + "hdmi-direct-slow-setup.rpt": { + "slack_ns": 5.472, + "sha256": "db1abaaac3116f8dd86e014718135d61159a005255d9c237bdff435cbd90584c" + }, + "hdmi-scaled-fast-hold.rpt": { + "slack_ns": 1.299, + "sha256": "3f7d43b4ae36e6aeee089d81838b18dfee093b6470b0de79f7956f80ec2cf372" + }, + "hdmi-scaled-fast-setup.rpt": { + "slack_ns": 0.61, + "sha256": "4da726e19eb7544bceade8c4ba4a1122b08cf6f4cc08e8d14410801d2e86d76d" + }, + "hdmi-scaled-slow-hold.rpt": { + "slack_ns": 0.961, + "sha256": "427fb35a5007d776f7b3c6bf99826ae83ede833913a4d13bf6eafa78cfbe11d9" + }, + "hdmi-scaled-slow-setup.rpt": { + "slack_ns": 0.089, + "sha256": "b0706b3b7d596bd1975d17821e532f55ebdd069b50e1d7a8eaaba67950563af6" + }, + "hdmi_audio-out-fast-hold.rpt": { + "slack_ns": 6.748, + "sha256": "6c1d347cd5b157e140fe00001e8fea7f139d92c95c5d7ecbea9378815f7ec906" + }, + "hdmi_audio-out-fast-setup.rpt": { + "slack_ns": 31.202, + "sha256": "f80d4b7133ae0e6028ae9d2ebf2aac9f7d0d383e3940ac90681c685dd2f46001" + }, + "hdmi_audio-out-slow-hold.rpt": { + "slack_ns": 14.244, + "sha256": "0df4045fb983c803989ec604b0af3880dc7ec53331c3019134ea6ac5f0a60c3b" + }, + "hdmi_audio-out-slow-setup.rpt": { + "slack_ns": 21.469, + "sha256": "2d3ac32b13e2c4db05a848ce8d9536f9b8bdbadbd83658f8923295d44919a781" + }, + "mcp_i2c-in-fast-hold.rpt": { + "slack_ns": 0.373, + "sha256": "8c236df475ee7915d1eee8563fbb706bb86a983cc2b5cedd7d1bb752963198f3" + }, + "mcp_i2c-in-fast-setup.rpt": { + "slack_ns": 35.821, + "sha256": "524e9fbaf4d1fa17cc561ac4cdf2374db76940891a65dda0e865eb17de4388de" + }, + "mcp_i2c-in-slow-hold.rpt": { + "slack_ns": 1.103, + "sha256": "0a90cebcac749d8e84fadd646dbb314d81f6b4267f1d0486acda46d577a314e9" + }, + "mcp_i2c-in-slow-setup.rpt": { + "slack_ns": 32.621, + "sha256": "07c659c0be89ee9324e618f45f0feb95a242797e3fc47786fccd791ff2eaf65f" + }, + "mcp_i2c-out-fast-hold.rpt": { + "slack_ns": 5.144, + "sha256": "55ad06536785e53daa2ba378ccb3d1eddf503d65e6e0264c3bf195273360fc44" + }, + "mcp_i2c-out-fast-setup.rpt": { + "slack_ns": 33.282, + "sha256": "5ced4f9a6b52da821cf39db7af23bc6f01c62e936d0d46dd29fd615c439495e0" + }, + "mcp_i2c-out-slow-hold.rpt": { + "slack_ns": 10.753, + "sha256": "b56182a714c3975a7fabe316f807eacc4547b2e0ed4a6c33f674621b646c50fd" + }, + "mcp_i2c-out-slow-setup.rpt": { + "slack_ns": 25.807, + "sha256": "f6fe60fb71ce6037c336e2cf24b012c14dc16d058539250a9db46bc1162b6973" + }, + "pixel-in-fast-hold.rpt": { + "slack_ns": 0.28, + "sha256": "993d296495945e48850e2990a788858d71cba0fdad826ab75c2cec179d7d1a92" + }, + "pixel-in-fast-setup.rpt": { + "slack_ns": 6.728, + "sha256": "5148ec8a160bf39a121e8bc9af1827c94e11074626174c31f5549f43b86ec5cf" + }, + "pixel-in-slow-hold.rpt": { + "slack_ns": 0.829, + "sha256": "b799d0de7fb77dc110a28404ec8e066117bd9000f161885121bb6fb0e663039b" + }, + "pixel-in-slow-setup.rpt": { + "slack_ns": 4.878, + "sha256": "3588f5d6c376f8cd94d89ffb28fb01822423d21f5d8700c4052dc6653df3088d" + }, + "pixel-out-fast-hold.rpt": { + "slack_ns": 0.28, + "sha256": "abbfe7132a3ad58bf93e882a71a218d8c8ef387dc0d8bc0036bba22263a1a2c2" + }, + "pixel-out-fast-setup.rpt": { + "slack_ns": 5.021, + "sha256": "cf766cb1ba50264905c5e0534181cbc2fa0d84d3050db6178c2d184c5a49fc13" + }, + "pixel-out-slow-hold.rpt": { + "slack_ns": 0.829, + "sha256": "f3a387c1017612f2f5b0f5af20011f1724d308663da392b2d169561aa2e540bd" + }, + "pixel-out-slow-setup.rpt": { + "slack_ns": 1.5, + "sha256": "6a8214758881b7361d473e51452c53cf248279aa6d543d1dff2404bfe19c831b" + }, + "sdram_command-out-fast-hold.rpt": { + "slack_ns": 2.673, + "sha256": "9401337aa7179a952a725bca1e568b5762e51a9e73fbfac13c0d2195ce970e8a" + }, + "sdram_command-out-fast-setup.rpt": { + "slack_ns": 2.089, + "sha256": "2aecf3fd3a98e31dcaeb724a2414e41065a6b06807e08350248bde8f3e9f02d5" + }, + "sdram_command-out-slow-hold.rpt": { + "slack_ns": 2.024, + "sha256": "e24863f15ff56bf9ef3cd4d4bf8ed0199ef45d058b3635e94e217deac12ad71b" + }, + "sdram_command-out-slow-setup.rpt": { + "slack_ns": 1.833, + "sha256": "87e1a53a6be3670298a42fee3cf7fc8788910933fa345a32d93c25fce9a83827" + }, + "sdram_dq-in-fast-hold.rpt": { + "slack_ns": 0.065, + "sha256": "da3a1451b3c382be01e8c9041b7234a9eda262df8622f656e149efa0fa33a6c5" + }, + "sdram_dq-in-fast-setup.rpt": { + "slack_ns": 3.264, + "sha256": "6cbd68b9506e3d29d823b997ce0cdde77329b6f9c2b1178fc1c7b1b845e0aa84" + }, + "sdram_dq-in-slow-hold.rpt": { + "slack_ns": 2.533, + "sha256": "80a41161dbd31b494ec87573bf5e6db4871eda3233dbd755062051159307991a" + }, + "sdram_dq-in-slow-setup.rpt": { + "slack_ns": 0.196, + "sha256": "ff9ebc61266dba26739ef6fd7c8307e33f0602c7675a25da8b61f3683dee657e" + }, + "sdram_dq-out-fast-hold.rpt": { + "slack_ns": 2.687, + "sha256": "03b78824d30ad05b074abba2ef72c7cb7a6d892bbf9ac8fb2a89defc444b3dd4" + }, + "sdram_dq-out-fast-setup.rpt": { + "slack_ns": 2.003, + "sha256": "ba19f7d5799b2ce96f6de0211ca75e7dcac3748ebc933f93d17c6b77f9d2569a" + }, + "sdram_dq-out-slow-hold.rpt": { + "slack_ns": 2.004, + "sha256": "75ba04420bde262783f6f3e683152cb94e3a149c46f4467caf34393123cc3d4c" + }, + "sdram_dq-out-slow-setup.rpt": { + "slack_ns": 1.614, + "sha256": "26c56f7e59640133c736d8450107d6f9725f6b76c13d4ab32a37b440cbba4046" + } + }, + "empty_synchronous_async_checks": [], + "log_sha256": "dfa8525bd82bc7dcd0688f9b44e20bddb71618964b7d1905a286eec33ef1d7d5", + "script_sha256": "ad4abacb7ac0ca9d99cb7f8a100316510424d97fcc70d5652f0f4c7912212e11" + } + }, + "audit_binding": { + "rbf_sha256": "768ee9db2923bf7b7acf7f57473c6c56f92d14ffc6d6bd88719148f80c9a2d42", + "inputs": { + "AMW.stp": "59799b5d57c9657ef6b2028999bea2cb794953a3fe3c68b2dc3fce75368d0813", + "COCO3_Comp.xlsx": "938d7504986d35669bd20857c7c29dcafa538a9cfed3cc70595b06d1893004e2", + "CoCo3.qpf": "44babfe2642e6f7a566ae773481bacc83aa59343cc7d49237592f3f525f5bbc6", + "CoCo3.qsf": "267d2b49871f975595493fe3afc35497997651397d62954ee2ee5d56cabfb834", + "CoCo3.srf": "49989d3f5b93bba318e096f04e717c5a2be68f42fb14ee37c10d460255b62bf7", + "CoCo3.sv": "3862fa092512f355038d3ac6bd8c01aa895da0310e2b721d25d555b4c76175ab", + "CoCo3FPGA.sdc": "7a0602fa0a15da3a2be98291ed2a04752b3ec8d256db8bd33718aa138b01866c", + "HD.stp": "c29540dbcc56deaa91bd4a838759cf9462250b2cd225cf551f4acf2598422f1a", + "HD2.stp": "b29d028394d5260a31a1ee59b1b595b951dd5201bdb12dd470674a2cee3a2681", + "Serial.stp": "e5ffa5dfc5d3496ccb7227cbbdb42c5e78a849a3933c5a8ea5c56746068b1ded", + "Video1.stp": "e94f9baae2ee75cd419494b385546876b7a3633c5f2c61b5ac51bec182804f03", + "Video_Explorer.stp": "66fde5d09c3c54054726b6cd4c5c5e44ddd199cbf418484081d86d02fc4017d6", + "Video_Explorer2.stp": "b125d02059c7871a068b3b0128dc2e6f075bc0c5c666e91eb4fe108445b12983", + "Vsync.stp": "51e8856a42caaa2652efec0afaa9521ab0047d77a7d28f473e5b1c0936fd5386", + "build_id_num.v": "83a1d8652f3307af5b693d8569d6929c8ea08e3a88b82176e658e67a6d2954eb", + "docs/Boot.vhd": "9bc0f35dc6f57cc3623146d20f817ac92da24f00d1441f0bf40700753ee323a1", + "docs/CoCo3FPGA.docx": "f5be57bedeb58de620f4cd8914d1c466a38e326fbad138cb033d96afa8fe1d0d", + "docs/CoCo3FPGA.pdf": "71c47607d12125c5486dad7d1d4ede7dc9a28389ba6216fa237b4ee69f32193a", + "docs/~$Co3FPGA.docx": "99f30a3eeb8e6c9dc78fded13fedbf750beb536f80d6ef82b16362cee6b92d9b", + "external-io.sdc": "67694509f8bb3323008de762076781f9ac542a493ecfc59292073983446d3278", + "files.qip": "ad042eb6fb28f1443f1af562be264e80552e5d47fae37553e849db18936fd51a", + "pll.xml": "fcaa430f0aa361bc4a4c8f9bf9f524b31bf0c8915330821fc843120f08e33d9c", + "releases/CoCo3_20211221.rbf": "2b11bffe31cc6b18b7b0d3099d445f4d624848ba7c0ba919f614c072fb15ef96", + "releases/CoCo3_20211229.rbf": "bf68e13febc5dd9319a7c5ba955eb8309578c8cd96ea952eea7a96853d376859", + "releases/CoCo3_20220124.rbf": "09be803a776f1baaba948dd62678e5edd4107d6d274200e49e76dcd3e32e5729", + "releases/CoCo3_20220211.rbf": "ddc50b452885f4440227da1c8e87b017cc007ee7048a29315235a31038fc5794", + "releases/CoCo3_20220219.rbf": "429aaf5ad6f7c5f8467c9551d76651a79840daf6292ce9e93a576ed48097c574", + "releases/CoCo3_20220226.rbf": "89422a751fcbcd604140ceec9db0a1f89fa67d28188caaecea773856c3c82082", + "releases/CoCo3_20230224.rbf": "872792ba23727478f79dad545703b46a89cfd2d3a741ca0aa3d8240e5e6305a5", + "releases/CoCo3_20231023.rbf": "daf8d0645722ffdb46594ba2996b96aa53b4c9a270782fc9c3bfff6f26e1ac17", + "releases/CoCo3_20240205.rbf": "817dcb4c6e95d1f2ce1e1f3a2e4e8e70c2ec9fcb1f497b20f0fcb8dea6dff8b6", + "releases/CoCo3_20240318.rbf": "1eb57f5c3c2dd42a24d4a6cff6aa77004e3627bc005f268949f9b6720e437e20", + "releases/CoCo3_20240514.rbf": "a6d23c62f6d1e12608f567a9da4997e99b1d22fb838f29e09e56dab8774bd845", + "releases/CoCo3_20260927.rbf": "1f73c6628b5b78a7efe8cfe3a7bb60fb05d7dc9f9f4d3e95771ee4464ecb44e3", + "releases/Tandy CoCo3 Overview.pdf": "249cace4054292cc84bd26e2f533f73cf554e6f148db9b58b8c60a6c5910eadb", + "reset-cpu.sdc": "87dac9d08fb26243cf8b90249b5ad8547590796241d2cfc94b688114318925e7", + "reset.stp": "1a9450490d28af0915d7e1ff2606cfdf2b22f1bddb64a4bac175d242720c5217", + "rom_Exploror.stp1": "c5bf08a6bf6cf5fc51341d56ba61a0cf99a984e63138d2dfab47dcc58e1a72bb", + "rtl/AMW.v": "748ee9fb6d8b7bde1c9f4f6b619a06eb6e5858b9f46e641236d32e1798089fa0", + "rtl/Auto_Run.sv": "ad57906fb7adf5685f8f3078f7355741386bb3cc014df2f62147ad46d12f1466", + "rtl/CPU09/6809Data.pdf": "f5fc61a75bad046277f6faeb8b25abb123a0ceeb7470b369b89310451b12d756", + "rtl/CPU09/cpu09_119.vhd": "6bc7971aeed4b8a75bc0035e71efb472d17e6bd248202ce7a15cf3c9df317fce", + "rtl/CPU09/cpu09_122.vhd": "4ec882cc35b344cd3aa15e90a1167f15d6e8966ea5c7c80c467f830f9ea1ebb7", + "rtl/CPU09/cpu09l_126.vhd": "c1a4569d8326b7ecb5fc0bbb6138593eb4ce3aa35453bc246e28062713fd4d14", + "rtl/CPU09/cpu09l_126x.vhd": "4b0f881053f367938ef6da574ec4e1ae7d5a35b6080d1ef3b77c8ec21577c37d", + "rtl/CPU09/cpu09l_127.vhd": "b4f88758cadcd57fdb626ad42a7558a23da732f8f0a580e1c92b4c5c9b0d80bf", + "rtl/CPU09/cpu09l_128.vhd": "f49ed673a2d6580d093c2cba8e11eb19306dac1d77a3eac9580402a4f4bcca31", + "rtl/CPU09/cpu09l_128a.vhd": "fbbb24ceabd32a98e9ebb9f303c841faf4a7c2e699709dafba952c4fc85eac45", + "rtl/CPU09/cpu09new_B15.vhd": "880190fe7684c9139d62b6dc7d84c5816bb9a40a2523fd7511a7b320baeb9f8a", + "rtl/Cassette_Write.sv": "f335e44c6827aca2f8756fdf4c090b9136ed625a217847e8f953701c11f367c1", + "rtl/CoCo3FPGA.sdc": "98dd3b41bf28ae3555f8fe3e13e36d156ef35093115cf08e2bda236dc81620e8", + "rtl/EE_Cold_Bt.v": "53265384140471177152839224e80ce9dea3a58aeca077fd493183aa8250dd8f", + "rtl/Mister_Video.v": "83500e27d8e50d19580bf337b088064a569ad4e0b536123c421b9cf2593a4878", + "rtl/OVO.vhd": "15e3d48657cf461fe3c17d5c2a26001248d4ad12d5ae015c3dd8ca19679165b9", + "rtl/PS2_Key/ps2_keyboard.v": "6eec7c87a77cd1adefa41323afb8d3384fc20e83cfc7e5c15df316ee0c5aeebe", + "rtl/UART_6551/6551rx.v": "fb68c3c4b99970209ec6c389329901d53bc34e317c99d9cb79dda7d3ed0ccad7", + "rtl/UART_6551/6551tx.v": "025c9117bf47ce60875cc7c3ec9f32bcfc0dab9af1d448b89e06705be7396bbf", + "rtl/UART_6551/uart_6551.v": "72a04083920a24736181d157a1ffdaf1581369efb0e41a65365bfe1e9dfa2bd8", + "rtl/VDAC.mif": "e195a39cbd63e4045c319770b1724bf74d076dfd39ea4a76824f00178e7ebf80", + "rtl/VDAC.qip": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "rtl/VDAC.v": "8fee8b34d709472748b2102ab94ab30b5d621a1f9ed5f8d0744c2199c148ea8c", + "rtl/bh_mpi_config.sv": "cb42863dad207370ccba35e41c2e6018fabd801d6b68b877f5a9031abf0569db", + "rtl/bh_mpi_rom.sv": "dad86cec0f5a92ed522015b85d928337776cf3ad91ec7362d487334831fdc382", + "rtl/bh_mpi_router.sv": "5ec1810afa4fe1b362605955be476968967ca791a38a9bd2bb01c246897ec2c4", + "rtl/cassette.v": "83e741835c3d90c9a4ec573593c1ec05bad86fae22d680ea047e3d5b64adda5e", + "rtl/coco3fpga.sv": "39be81ca39760850b0d44c7a2af15225ccbc24d3bea6a75eaa40f58d1d75a7e0", + "rtl/coco_mem_fetch.sv": "d9d871ec0ff12eaee889888a5876f320417f96b572b2ca16153f1007e568ee71", + "rtl/cocokey.v": "37c14e7e48fd7d74bbee6abe530ba45c554f73ca6fb9bdeb70f46dfa4fe55bb6", + "rtl/config.sv": "8a2a74e0c8d58410432f365b96dd5cf5bb54d877627997b6b919131f7821fdf4", + "rtl/cpu_sdram_bridge.sv": "2ac82076548ea235ed5d1c9ef438ae7452f190aecab31a29bc650c8d84ed875d", + "rtl/fdc.sv": "ea3076a0752b4674b4394c93f12a109237fdbe86737956bccec85e737e11110e", + "rtl/mc6809glb/mc6809glb.v": "29c84e1bf316fdd5a1a8b7a0343569a30e4b8ea0e4809e6fa1f6d4bd899ca00e", + "rtl/pll.ppf": "d8deb975a2d5826c460c5f6446860dfe85babd23905d42e2a5c2e77a08433dbd", + "rtl/pll.qip": "70215fd33c10af64df666f32faed94ab4d3c145b997c414dcb30342cf37f184c", + "rtl/pll.sip": "e675771bdb4b484889c1518a1b94ddd62a887e63e1f7d693742dab4ee2be5f8c", + "rtl/pll.spd": "b6c257356adbd72ca3bafecfcd19a9fc949be025ce81b9952307a8389f6a7b2f", + "rtl/pll.v": "58c479233d7baf971f7f2532dc145775e08e8c8c3956ab8681563aad7e09ecfe", + "rtl/pll/pll_0002.qip": "87733565096fce9f034019ca43b32dcb6b2c2413999fccd3d5dcf3e3191652d2", + "rtl/pll/pll_0002.v": "38b4a07902f5602361e1b923a0c9cd3271976b375e2cc17137e9f3b3f29c3938", + "rtl/ps2_mouse.v": "60f0f8cc82cd41728a2e0414d54058934a33d7b80309840e6461676457d2689c", + "rtl/rom/coco3_char_rom.vhd": "83735477cdad66a1549f45401c6651c75271f81f880b54eef2bba94502555707", + "rtl/rom/coco_rom_16.vhd": "0e39fdc3a2fe1938c23a7146ed04a35cc13a44ba39bd1c29bebb3132412fae90", + "rtl/rom/coco_rom_32K.vhd": "219d07d8d81da38178b3b2f39387b96619420098805a7a8866cbff7bbc969271", + "rtl/rom/coco_rom_8K.vhd": "5e90985003715c029235bb41e8bb6bfc0abc3bc77239fae4a77c947f5bcafeb1", + "rtl/rom/coco_rom_cart.vhd": "dd7675b06f908a97d39cb7ca973fb8be050e37d01097d206e8142762af9ff908", + "rtl/rtc.sv": "e1816ac2a250aad5417a6c007f819dc00bdff6c531c90fb13e86906e79cefc8a", + "rtl/sdc.sv": "5aa768daa6af438f7aadfa3fd247a3b09fc7787a3e805a9ae26690bb23e17f68", + "rtl/sdc_top.sv": "df869df91f59d84a044140cf048d5605632f0bcd0078049790854acc50d433ce", + "rtl/sdram/sdram2.sv": "43ff3eb494b4d65b83467a9426ab1a7d9208e96e3bac4a21f4ef4b9faeac5e59", + "rtl/square_gen.v": "908ebcfe32865780d15499078e717b39e19ebe1c3f8315bcbab1418387924d5e", + "rtl/sram/coco_ram.vhd": "8f61548abaf74d08462370f75b826e498be123cb5b453952894d63c65906d596", + "rtl/sram/coco_vid_ram_buf.vhd": "d977d473ea0d773ccb7aee81ed4202f9976ba5854ea3ae0189432cbfe99f9be3", + "rtl/ssc/LICENSE": "204dd45efd32cbf07d425b03bb19e9e9da48d32036fe2b5ceb81d56ed502dc71", + "rtl/ssc/ssc_audio.sv": "1e368e0eb6a4f58ca29d0c0b69352b52709dc58cae548549da8f9377aaf3caa8", + "rtl/ssc/ssc_ay8913.sv": "a21fbded914d3d2a5eb8b4b080f5140d0018116335860c976aea6d11da8e7a5f", + "rtl/ssc/ssc_cartridge.sv": "50df91d332f19f6d4ad302f9dc6774052f58a075bd13c6d3835f4e4993b0d4c3", + "rtl/ssc/ssc_glue.sv": "f91f20146447bde4f938110460845bbc055fbe258f47517e430050a6de890994", + "rtl/ssc/ssc_host.sv": "a92a2d9ad6df056d7a15eb89c9fe8199090c02422b6313c4a6d55b218a27f7bd", + "rtl/ssc/ssc_mister_bridge.sv": "0986a4e97bf7887f48f076a5b0f4a19981f69103bf11d0083f9a1c7c882557d1", + "rtl/ssc/ssc_sp0256.sv": "43e045008d6aa8f867e5c9fd800666ab531e194c6cde6d936a1669b8e5d148c2", + "rtl/ssc/ssc_sp0256_memory.sv": "68d2da460a216741ec6c2119202761a3eaaf4e6ad92362698f4915495a9bdc05", + "rtl/ssc/ssc_sp0256_tables.vh": "4cd641a20916208c776ee57478f5ead9e16ceecab770f1c357972fb14496daec", + "rtl/ssc/ssc_tms7000.sv": "88910f452e10b9b07521d81e7ee1803da80ead98d8d988a78d6d933a221e2928", + "rtl/ssc/ssc_tms7000_alu.sv": "1389c648ca6f345b0537fbf3f99cfddd06568e12a7cdf8cf9309418ba131136e", + "rtl/ssc/ssc_tms7000_bcd.sv": "1b220b6c1f61a59009a7aabc166af1e6a8095029f6acb2b4e6681f0cb663106d", + "rtl/ssc/ssc_tms7000_decode.sv": "a3f5cc75814e7ad974653d39cbc19bf1bbf04f6d049a9fac310fc7fc91bf8484", + "rtl/ssc/ssc_tms7000_defs.vh": "96ce2894dfaf8cfbc1f382606bca5db89b3907ea12c99effb81656c0cbb0a171", + "rtl/ssc/ssc_tms7000_exec.sv": "366046cea5874d3c82ade20d453a9e40a300d3735715afbcdb23a1a34dc1b2df", + "rtl/ssc/ssc_tms7000_io.sv": "14cf030b8337a7e4c3d6a96bf0f9ea0789c45dba6df9b7124e2d9e581b6f234f", + "rtl/ssc/ssc_tms7000_memory.sv": "87e05cef8baa70eba9a43aa721e507b1becba8c975123cbc147cd0b548d105b0", + "rtl/ssc/ssc_tms7000_pacer.sv": "44a57567298ba1ac8807a65c2a117f4a6f43f34574fcfeb6da9c121847091d61", + "rtl/wd1793.sv": "31ca50b27294edbcc617958bf315341e40ba61438711382b5a320252b8d949e8", + "sys/alsa.sv": "74943b658cd3f4adc5b74c72f225fb42b95122a1c5e453df860a4c6a9bf72fc9", + "sys/arcade_video.v": "ce64cdd7f900ded7b9cd9aa728dab7383b7561cdc75dfe82ab23fe27a3d217d3", + "sys/ascal.vhd": "3f74c7b52d749cf523b11cbd06a9269f831ad86967ee983b4a0d1f5792b645f6", + "sys/audio_out.v": "565dd9badb00052dbd324e70f7ab66e8c6ecd0c5c2791aebffe477a2c0669363", + "sys/build_id.tcl": "09d23b2a31bc1e04a3b9d4a8632d777eac9b10893b3a3f38b7f18f6fcc41ebee", + "sys/ddr_svc.sv": "8dfa874b9a93b4dbbe3b2fcf4f9035a895262cc090d398f4099941a626f41c08", + "sys/f2sdram_safe_terminator.sv": "400bcbcfc0b4aae324fe813866a5443d577bf4de9b4ab1454cb068733d170261", + "sys/gamma_corr.sv": "2754944c6fe05d921374d1fecc26621782520b3bc6fbf600ca561e9f37c7af88", + "sys/hps_io.sv": "1182da0710483a1030687c12e6601025a5293ab90f2eb15cdf5fdea38ea4c275", + "sys/hq2x.sv": "2146b69cf63c26a4b41407e9ac1b4462db4d7e3ea6d8a99f31ba12712d68f975", + "sys/i2c.v": "f41fea50a4cc3341b84b797e5383de070fafb08b31c94936eff51f9f6223c6bc", + "sys/i2s.v": "927d2aea6797fb837f383e5e8a3259609e132ed24883127240ab21601f467efa", + "sys/iir_filter.v": "570a8095c15af84a60015b5eab105cee6e2d7edde77e20f0ce40c075ab2db8b7", + "sys/ltc2308.sv": "825fa1197c8e9f31c19c2fef1b01693133fb7df3cfb2dd831f2848a98fc6899c", + "sys/math.sv": "d384fa9fcf73100cb28a2affc5db1e4aacc87620287971c3882507fc3af056cc", + "sys/mcp23009.sv": "b112bd5f422457913b691613994fcd4afa70940aa3fde93e5674fa76d50e34ce", + "sys/mt32pi.sv": "4ad39571d16a4b25347030d75ffdf601803ddec71e2e3fcabe962103cc45a1a2", + "sys/osd.v": "68ec08401a6ddaf68c95a2e976b9085b77f0002d5b64ffed7454055dbcc48062", + "sys/pll.13.qip": "f25f58e7c0290583f33ee0fdd729a4470cc69312686f0f1ecb95c61115d61cec", + "sys/pll_audio.13.qip": "60edce734c54e4b9f9d56f078bc797841e52c6817f4d27e0cfe77db5d77b2596", + "sys/pll_audio.qip": "278496eefe70d18f6b3ccf624c3a4595ccca74a9a6740eb4520200f1e929a236", + "sys/pll_audio.v": "1662fff7650cd443db81db7f0707f5583d223372b3e3c41af2d41ea4f3ac38f3", + "sys/pll_audio/pll_audio_0002.qip": "4cedd5394006286e0be61acdcbb6455f35cdf5c1488f4eb4a76b60e20eb43fb8", + "sys/pll_audio/pll_audio_0002.v": "2b24d2a561d81cc8b20f725884ee9c243e619058e42ebcdcf6f491d33008696c", + "sys/pll_cfg.qip": "7c1573f321012132479272242434d02058b1bcfe8d89843130ef11173a901eae", + "sys/pll_cfg.v": "e07ae93193537830b3bc9029465e763a6bfe354c25b7e7747eeeb4094b08ad10", + "sys/pll_cfg/altera_pll_reconfig_core.v": "9058d2c68e9cb0b1b6b3ab5487daad8aeaf04461e162aba317857dd133329189", + "sys/pll_cfg/altera_pll_reconfig_top.v": "34c11c19e6bf3797d2db2e41314ce802f5a01041265ce943b54e7f20eb2027c9", + "sys/pll_cfg/pll_cfg.v": "89750669762947128e105736d82384587f1cf8ac2f9965090e483c20f7624d59", + "sys/pll_cfg/pll_cfg_hdmi.v": "d3874dda124af03656054fa1ae1ee70f1a4d3cea6d4670795a5168325bb6760a", + "sys/pll_cfg_hdmi.v": "e139f13dcd4cad01bb2ae1cdade7e608508bf973f79b0190bb6e833c06472650", + "sys/pll_hdmi.13.qip": "625df824716313233400454bc1142615fb3a234a494225691c8a554753b1731b", + "sys/pll_hdmi.qip": "5571604010bf98858a0797a2286d2389e105d32a97b42508865b02ba4237dd0d", + "sys/pll_hdmi.v": "499561547c1045a46f1137558e2bab83d8e026e5d32669b5c5779a264b7ed676", + "sys/pll_hdmi/pll_hdmi_0002.qip": "de648286a832ee72839dd6abb444231a4238d32b2c26f29426399d2221d7bf5b", + "sys/pll_hdmi/pll_hdmi_0002.v": "27c77f35c89e97994477801f83edf3c7e9c5b9e57df49864434d300c40e9f1f7", + "sys/pll_hdmi_adj.vhd": "ae18c82eef2f6b9c7783c68ac272d03f570eb1bdaddce14a1908c351da51a71b", + "sys/pll_q13.qip": "c2b9c95a49d9b1100b0640bbdeea1acff845b0a8cbc11a7259c0913d2c61cfa8", + "sys/pll_q17.qip": "7139faf33ae28066e805f290b15401eddb092d4b7d31b529a3ce1f0213fbc90a", + "sys/scandoubler.v": "d36181c5fde9df0a504c547e23f60bcf201420052ada2682f081b00fd9485e6b", + "sys/scanlines.v": "1fc7ac5359fd224a3fc06388f7671e07bf57cf6a39f35803a265661c56c564d4", + "sys/sd_card.sv": "25114f9a0e9ab4dd702633ae927fc825dc79a4d9f7746c1bb75dbd10d61eb6d6", + "sys/shadowmask.sv": "88429d137b4ce9f6538a052f03d874604f46decf6d69b3fc824cc795efcf3193", + "sys/sigma_delta_dac.v": "352d31dd185bce14d9d1e8a4999fbb5f2b5b2e42b048bdc9f4b828119cc5127a", + "sys/spdif.v": "a617bba332c4611caf81ba585b8f6828c7899aec5f81664a870f10419cb9b451", + "sys/sys.qip": "3854d7f172097e01a40037e0a82dfd1a4178391ea0964767492979216279f31d", + "sys/sys.tcl": "e9ab2b7c89b4347854810387550a65458aa3ec9de1bd26ad74328d73376f6a88", + "sys/sys_analog.tcl": "e4cbfd22985fa046b546c0cfc626fccf773d9098b7c6a595f8bea66d67d25203", + "sys/sys_dual_sdram.tcl": "4f41376069b2070079d8ba4ae4a722c8ecfe3ca4b99798d0bdd8cda986b5ad5b", + "sys/sys_top.sdc": "0a5fa4015b82ad7ce38e56d1ae4aadea6209af59c5dd9eff56a11139cf16ce86", + "sys/sys_top.v": "1bc7cc0ad6f8d03b9933f576cb8e2537f68aa335e79871bbc2380b8d0c9b0938", + "sys/sysmem.sv": "9f8cf78563cc31beb7dfc6d7048c51ba536ff4f1f9f640b4ff9f8d574456c94e", + "sys/vga_out.sv": "02a533c3dfd547afddea2946019ecc79bbe9c27bb6128c0999fa5fc9e78f8108", + "sys/video_cleaner.sv": "44b986d9bf8412e56bf8e4eae3dc87e04b4c378e58ec6119de5a8aed320e3572", + "sys/video_freak.sv": "6a9b8565f66894a8f2ec10c916593e980d260f29f1886bfe70bf6f3b0cf6edc0", + "sys/video_freezer.sv": "0f3f4710b072b7e90b0b6bfe7607dec18dbd6bed78d1994f32d6fa72a6b7aef3", + "sys/video_mixer.sv": "31ed2c917bd6680b4d60328e71a4f28015bd5fcec21e15b290eacec88971167d", + "sys/yc_out.sv": "c52d7bfcc8dbc5a0cda2b3117172cbba790fb97b7de61722ddac205f6ec8bc20", + "uart-reset.sdc": "15ecd89405d0e384ad0eba8954e3f4585583942f55238c34f3b98eb2e4934943" + }, + "fitted_sof_sha256": "aaf203b7ce093ab554bc76909d8e30a286b33524e689cba4d9b9c241e9d72e64", + "scripts": { + "bh_mpi_timing": "fcf877488563a76bd5d5deb67187055a3a5a9cc6b5f7ee2379c76f95ca7cc690", + "nmi_timing_paths": "b7ad08df23e83f98773abe7c27c66dd97add20aeabffac8a1674382bf6e9c717", + "uart_timing_paths": "004268b1655afc9b060a96589ff552398b77284970d2804197476b21b2f1a543", + "reset_cpu_timing_paths": "8ac4ea0e160822043a1246b95f7a290a7a8ee8c15c29b7c17c8c734148ad703c", + "video_timing_paths": "cc68d1180e85ec810618fd8ce7e4a6a556a4ece68db5351da36d66be8d1babb4", + "ssc_integrated_timing": "52d8de4e547714e25f34cdf19f40293bb978172232af5c87eec32156013c3e94", + "external_io_timing": "ad4abacb7ac0ca9d99cb7f8a100316510424d97fcc70d5652f0f4c7912212e11" + } + }, + "unconstrained_counts": { + "Illegal Clocks": { + "setup": 0, + "hold": 0 + }, + "Unconstrained Clocks": { + "setup": 0, + "hold": 0 + }, + "Unconstrained Input Ports": { + "setup": 5, + "hold": 5 + }, + "Unconstrained Input Port Paths": { + "setup": 209, + "hold": 209 + }, + "Unconstrained Output Ports": { + "setup": 20, + "hold": 21 + }, + "Unconstrained Output Port Paths": { + "setup": 694, + "hold": 707 + } + }, + "remaining_pin_contracts": { + "input_ports": { + "HDMI_I2C_SDA": "HPS hard I2C peripheral boundary: fabric STA does not prove slave bus timing", + "SDCD_SPDIF": "Mode-dependent asynchronous card detect / SPDIF output", + "USER_IO[1]": "Optional external UART input: UART synchronizer and direct bit-banged PIA fanout", + "altera_reserved_tdi": "Tool-generated JTAG interface: separate programming/test timing contract", + "altera_reserved_tms": "Tool-generated JTAG interface: separate programming/test timing contract" + }, + "output_ports": { + "HDMI_I2C_SCL": "HPS hard I2C peripheral boundary: fabric STA does not prove slave bus timing", + "HDMI_I2C_SDA": "HPS hard I2C peripheral boundary: fabric STA does not prove slave bus timing", + "HDMI_MCLK": "Forwarded audio clock: clock waveform/output latency, not a data receiver", + "LED[2]": "Human status indicator / overtake mode; no synchronous external receiver", + "LED[6]": "Human status indicator / overtake mode; no synchronous external receiver", + "SDCD_SPDIF": "Mode-dependent asynchronous card detect / SPDIF output", + "SDIO_CLK": "Mode-dependent HPS SD-SPI / analog VGA mux; cannot use one synchronous pin budget", + "SDIO_CMD": "Mode-dependent HPS SD-SPI / analog VGA mux; cannot use one synchronous pin budget", + "SDIO_DAT[0]": "Mode-dependent HPS SD-SPI / analog VGA mux; cannot use one synchronous pin budget", + "SDIO_DAT[1]": "Mode-dependent HPS SD-SPI / analog VGA mux; cannot use one synchronous pin budget", + "SDIO_DAT[2]": "Mode-dependent HPS SD-SPI / analog VGA mux; cannot use one synchronous pin budget", + "SDIO_DAT[3]": "Mode-dependent HPS SD-SPI / analog VGA mux; cannot use one synchronous pin budget", + "SD_SPI_CS": "Mode-dependent HPS SD-SPI / analog VGA mux; cannot use one synchronous pin budget", + "USER_IO[0]": "Open-drain serial/debug output or alternate I2S; receiver/RC is external", + "USER_IO[2]": "Open-drain serial/debug output or alternate I2S; receiver/RC is external", + "USER_IO[3]": "Open-drain serial/debug output or alternate I2S; receiver/RC is external", + "USER_IO[4]": "Open-drain serial/debug output or alternate I2S; receiver/RC is external", + "USER_IO[5]": "Open-drain serial/debug output or alternate I2S; receiver/RC is external", + "USER_IO[6]": "Open-drain serial/debug output or alternate I2S; receiver/RC is external", + "altera_reserved_tdo": "Tool-generated JTAG interface: separate programming/test timing contract" + } + }, + "first_reconstruction_rbf_sha256": "a4b6ef0b3641bbbc1b42de88502b677a1ec5e3809e2a17abf6f1e75c2a38451e", + "limitations": { + "whole_board_electrical_certification": false, + "physical_power_cycle": false, + "sd_image_first_boot": false + }, + "scope": "Standalone build and both-corner path qualification; conditional SDRAM/PCB assumptions retained; deployment recorded separately", + "final_harness_checks": { + "ssc_actual_bindings": { + "passed": true, + "phi": 127675, + "host_bytes": 14, + "host_reads": 14, + "audio_changes": 144, + "speech_nonzero": 100 + }, + "startup_native_cases": 7, + "menu_native_pages": 9, + "menu_status_options": 23, + "menu_visibility_masks": 65536, + "tooling_guard_tests": 8, + "formatting_only_cleanup": true + } +} diff --git a/validation/upstream-refs.json b/validation/upstream-refs.json new file mode 100644 index 0000000..18616c5 --- /dev/null +++ b/validation/upstream-refs.json @@ -0,0 +1,19 @@ +{ + "source": "https://github.com/MiSTer-devel/CoCo3_MiSTer", + "refs": [ + "def4bc0b5b6457ea5e83d830ed5de1e090691d4b refs/heads/FujiNet_V1.00", + "5d93c0501f398eeac1da43c8eaca519874e04eb9 refs/heads/Gemi-Grph-Error-Testing", + "54420d958ff87ec5c20b8d673d880238cb5eb849 refs/heads/Mister_Video.v_Update", + "da09ad34fc9238f8bf39b2a736d9a36c3a179274 refs/heads/Speech_Music", + "ede23da6b07aaf6e060d1b150f6c8e2e86694afc refs/heads/Timing_Update", + "8b8cf72d1fb4de1d05345de8d5b92ec2d500fcd2 refs/heads/master", + "9e70212e87dec468a796ccef5045c7941a565d4c refs/heads/verilator-sim-fujinet-serial", + "e433c8d2c39323ce9b4ae1578aa40cfbbef20635 refs/pull/14/head", + "e58c44e93cbbfaaafc42c40a114201db28b24246 refs/pull/14/merge", + "aaf622a2aa07afa9873bfd4f711ce0a591d5c676 refs/pull/17/head", + "9e70212e87dec468a796ccef5045c7941a565d4c refs/pull/18/head", + "0e0aceff3aad0be4d884509b75ee0864eb0cd171 refs/pull/18/merge", + "755369c3f7861a018a314b27adfd421b2bc68b9e refs/tags/unstable-builds" + ], + "pull_request_mapping": "refs/pull/N/KIND -> refs/heads/upstream-pr/N-KIND" +} diff --git a/windows/Build-FPGA.ps1 b/windows/Build-FPGA.ps1 new file mode 100644 index 0000000..f7b0824 --- /dev/null +++ b/windows/Build-FPGA.ps1 @@ -0,0 +1,8 @@ +param([string]$Python = 'python', [Parameter(Mandatory=$true)][string]$QuartusSh, [string]$Output, [switch]$PrepareOnly) +$ErrorActionPreference = 'Stop' +$root = Split-Path -Parent $PSScriptRoot +$arguments = @('-X','utf8','-B',(Join-Path $root 'tools/build_fpga.py'),'--quartus',$QuartusSh) +if ($Output) { $arguments += @('--output',$Output) } +if ($PrepareOnly) { $arguments += '--prepare-only' } +& $Python @arguments +if ($LASTEXITCODE -ne 0) { throw 'FPGA build or timing-summary verification failed.' } diff --git a/windows/Build-ROMs.ps1 b/windows/Build-ROMs.ps1 new file mode 100644 index 0000000..edb2c54 --- /dev/null +++ b/windows/Build-ROMs.ps1 @@ -0,0 +1,8 @@ +param([string]$Python = 'python', [string]$Lwasm, [string]$Output) +$ErrorActionPreference = 'Stop' +$root = Split-Path -Parent $PSScriptRoot +$arguments = @('-X','utf8','-B',(Join-Path $root 'tools/build_roms.py')) +if ($Lwasm) { $arguments += @('--lwasm',$Lwasm) } +if ($Output) { $arguments += @('--output',$Output) } +& $Python @arguments +if ($LASTEXITCODE -ne 0) { throw 'ROM assembly/identity verification failed.' } diff --git a/windows/Install-MiSTer.ps1 b/windows/Install-MiSTer.ps1 new file mode 100644 index 0000000..75fbcc8 --- /dev/null +++ b/windows/Install-MiSTer.ps1 @@ -0,0 +1,10 @@ +[CmdletBinding()] +param([string]$Python='python',[string]$HostName,[string]$UserName='root',[string]$Release,[switch]$WithoutSSC,[switch]$Load) +$ErrorActionPreference='Stop' +$scriptArgs=@('-X','utf8','-B',"$PSScriptRoot/../tools/install_mister.py",'--user',$UserName) +if ($HostName) {$scriptArgs+=@('--host',$HostName)} +if ($Release) {$scriptArgs+=@('--release',$Release)} +if ($WithoutSSC) {$scriptArgs+='--without-ssc'} +if ($Load) {$scriptArgs+='--load'} +& $Python @scriptArgs +if ($LASTEXITCODE -ne 0) {throw 'Install failed; inspect output and preserve the backup/staging directory.'} diff --git a/windows/Package-Release.ps1 b/windows/Package-Release.ps1 new file mode 100644 index 0000000..5e1b05f --- /dev/null +++ b/windows/Package-Release.ps1 @@ -0,0 +1,9 @@ +[CmdletBinding()] +param([string]$Python='python',[string]$Output,[switch]$WithoutSSC,[switch]$PublicPackage) +$ErrorActionPreference='Stop' +$scriptArgs=@('-X','utf8','-B',"$PSScriptRoot/../tools/release.py") +if ($Output) {$scriptArgs+=@('--output',$Output)} +if ($WithoutSSC) {$scriptArgs+='--without-ssc'} +if ($PublicPackage) {$scriptArgs+='--public'} +& $Python @scriptArgs +if ($LASTEXITCODE -ne 0) {throw 'Packaging failed.'} diff --git a/windows/Setup-Tools.ps1 b/windows/Setup-Tools.ps1 new file mode 100644 index 0000000..6b38e4b --- /dev/null +++ b/windows/Setup-Tools.ps1 @@ -0,0 +1,8 @@ +param([string]$Python = 'python', [switch]$IncludeSimulator, [string]$Cache) +$ErrorActionPreference = 'Stop' +$root = Split-Path -Parent $PSScriptRoot +$arguments = @('-X','utf8','-B', (Join-Path $root 'tools/bootstrap.py')) +if ($IncludeSimulator) { $arguments += @('--only','lwtools','cocoroms','main','simulator') } +if ($Cache) { $arguments += @('--cache',$Cache) } +& $Python @arguments +if ($LASTEXITCODE -ne 0) { throw 'Public tool/source setup failed; preserve the cache and inspect the error.' } diff --git a/windows/Test.ps1 b/windows/Test.ps1 new file mode 100644 index 0000000..e1aab41 --- /dev/null +++ b/windows/Test.ps1 @@ -0,0 +1,7 @@ +[CmdletBinding()] +param([string]$Python='python',[string]$Suite="$PSScriptRoot/../.tools/oss-cad/oss-cad-suite",[string]$MainReference="$PSScriptRoot/../.deps/main",[string]$Output) +$ErrorActionPreference='Stop' +$scriptArgs=@('-X','utf8','-B',"$PSScriptRoot/../scripts/run_regressions.py",'--suite',$Suite,'--main-reference',$MainReference) +if ($Output) {$scriptArgs+=@('--output',$Output)} +& $Python @scriptArgs +if ($LASTEXITCODE -ne 0) {throw 'Functional validation failed.'}