# 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