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

+63
View File
@@ -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