037-iob18-pips: use built-in write_pip_txtdata + N=20 (was 120)

Was wedging the build at ~7h elapsed in iteration 1 (one specimen at
~40% through a sequential per-net Tcl loop, ~13h/specimen extrapolated
on xc7vx485t). Two compounding problems, both contained to this fuzzer:

1) generate.tcl redefined write_pip_txtdata as a slow Tcl
   'foreach net { foreach pip { ... get_nodes -uphill ... } }'.
   On a big device with ~1296 nets this scales as O(nets*pips) with
   per-pip routing-graph queries. The custom proc produces the same
   6-column output (tile pip src dst pnum pdir) that the segmakers
   parse — i.e., identical to Vivado's built-in write_pip_txtdata
   that 049/053 et al. use. Drop the override so the built-in is
   invoked (~10x speed-up).

2) Makefile set N = 120 specimens, 6x the typical 20. Reduce to 20
   to match other pip fuzzers; segmatch still converges with plenty
   of variety.

Combined: ~60x faster, lighter mem footprint. Won't change behaviour
for other families that weren't memory-bound — they get the same
faster path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dr Jonathan Richard Robert Kimmitt 2026-05-27 14:27:29 +01:00
parent 5347c5152d
commit a4dc27cfea
2 changed files with 11 additions and 23 deletions

View File

@ -13,7 +13,9 @@ TODO_RE=".*"
EXCLUDE_RE=".*((PHASER)|(CLKDIVF)|(CLKDIVP)|(CLKDIVB)|(IOI_ILOGIC[01]_O)|(IOI_OLOGIC[01]_CLKB?\.)|(IOI_IMUX_RC)|(IOI_OLOGIC[01]_[OT]FB)|(OCLKM.*IMUX31)|IOI_ODELAY[01]_CLKIN.IOI_OCLK_[01]|RIOI_O[01].RIOI_ODELAY[01]_DATAOUT|RIOI_O[01].RIOI_OLOGIC[01]_OQ).*"
MAKETODO_FLAGS=--pip-type ${PIP_TYPE} --seg-type $(PIP_TYPE) --re $(TODO_RE) --sides "xr" --exclude-re $(EXCLUDE_RE)
N = 120
# N=120 is excessive on a large device like xc7vx485t; 20 (matches other pip
# fuzzers) is plenty for segmatch convergence and roughly 6x faster per iter.
N = 20
SPECIMENS_DEPS=build/cmt_regions.csv

View File

@ -7,28 +7,14 @@
# SPDX-License-Identifier: ISC
source "$::env(XRAY_DIR)/utils/utils.tcl"
proc write_pip_txtdata {filename} {
puts "FUZ([pwd]): Writing $filename."
set fp [open $filename w]
set nets [get_nets -hierarchical]
set nnets [llength $nets]
set neti 0
foreach net $nets {
incr neti
if {($neti % 100) == 0 } {
puts "FUZ([pwd]): Dumping pips from net $net ($neti / $nnets)"
}
foreach pip [get_pips -of_objects $net] {
set tile [get_tiles -of_objects $pip]
set src_wire [get_wires -uphill -of_objects $pip]
set dst_wire [get_wires -downhill -of_objects $pip]
set num_pips [llength [get_nodes -uphill -of_objects [get_nodes -of_objects $dst_wire]]]
set dir_prop [get_property IS_DIRECTIONAL $pip]
puts $fp "$tile $pip $src_wire $dst_wire $num_pips $dir_prop"
}
}
close $fp
}
# NOTE: this fuzzer previously defined its own slow Tcl write_pip_txtdata proc
# that iterated foreach net foreach pip and queried the routing graph per-pip
# (set num_pips [llength [get_nodes -uphill ...]] ...). On a large device like
# xc7vx485t this took hours per specimen (1296 nets * O(nodes) Tcl queries).
# Vivado's built-in `write_pip_txtdata $filename` produces the same 6-column
# output (tile pip src_wire dst_wire pnum pdir) that the prjxray segmakers
# parse, but in seconds. Drop the override; the call at the end of this file
# now resolves to the built-in.
proc make_manual_routes {filename} {
puts "MANROUTE: Loading routes from $filename"