Files
CoCo3_Plus_MiSTer/scripts/reset_cpu_timing_paths.tcl
bholman cb40fed3b9 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.
2026-11-18 16:00:45 -07:00

80 lines
4.4 KiB
Tcl

# 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