Introduce Coco 3 Plus for MiSTer

Add original-firmware Sound & Speech, four configurable Multi-Pak sockets,
bounded per-slot ROM allocation and a nine-page menu organized around devices
and media. Repair inherited clock/reset/CPU-memory/video paths and add explicit
conditional external-I/O timing contracts. Preserve native Main startup-file
ordering, saved layouts, stock-core separation and the coco3plus media profile.

Provide native Windows tool downloads, pinned ToolShed ROM assembly, fresh
Quartus builds, functional and fitted timing checks, reviewed release packaging
and passwordless SSH installation with backups. Retain original component
notices, document contribution copyright and keep SSC ROM inputs outside Git.

Validation: Quartus17.0.2 Build602 seed5, zero errors; 15 functional jobs,
368 both-corner timing scopes and eight tooling-integrity checks pass.
The renamed build reaches Disk BASIC, PRINT1+1 returns2 and SSC loads ready.
Physical cold power cycling and conditional board-delay assumptions remain
separate. Full original upstream histories are preserved before this single
consolidated implementation commit.
This commit is contained in:
bholman committed 2026-11-18 16:00:45 -07:00
1 parent 8b8cf72d1f
commit cb40fed3b9
126 files changed
+12795 -528

No files matched your search

+61
View File
@@ -0,0 +1,61 @@
`timescale 1ns/1ps
module disk_buffer_pipeline_tb;
reg clk=0,enable=0,sampling=0;
always #10 clk=~clk;
integer period=2,tick=0,reads=0;
reg [8:0] sdc_pointer=0;
reg [10:0] wd_pointer=0,write_address=0;
reg [7:0] write_data=0;
reg writing=0,sdc_writing=0;
wire [7:0] sdc_raw,wd_raw,sdc_piped,wd_piped;
sdc_dpram sdc_memory(.clock(clk),.address_a(write_address[8:0]),.data_a(write_data),.wren_a(sdc_writing),
.address_b(sdc_pointer),.data_b(8'd0),.wren_b(1'b0),.q_b(sdc_raw));
wd1793_dpram wd_memory(.clock(~clk),.address_a(write_address),.data_a(write_data),.wren_a(writing),
.address_b(wd_pointer),.data_b(8'd0),.wren_b(1'b0),.q_b(wd_raw));
actual_sdc_pipeline sdc_pipe(clk,sdc_raw,sdc_piped);
actual_wd_pipeline wd_pipe(~clk,1'b1,wd_raw,8'd0,wd_piped);
function [7:0] pattern(input integer value);
pattern=(value^(value>>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