From a4dc27cfea1befc0fd1909be86d1c88dc2a28473 Mon Sep 17 00:00:00 2001 From: Dr Jonathan Richard Robert Kimmitt Date: Wed, 27 May 2026 14:27:29 +0100 Subject: [PATCH] 037-iob18-pips: use built-in write_pip_txtdata + N=20 (was 120) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- fuzzers/037-iob18-pips/Makefile | 4 +++- fuzzers/037-iob18-pips/generate.tcl | 30 ++++++++--------------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/fuzzers/037-iob18-pips/Makefile b/fuzzers/037-iob18-pips/Makefile index cef61988..cc1b9e3a 100644 --- a/fuzzers/037-iob18-pips/Makefile +++ b/fuzzers/037-iob18-pips/Makefile @@ -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 diff --git a/fuzzers/037-iob18-pips/generate.tcl b/fuzzers/037-iob18-pips/generate.tcl index 65d692d7..0c918824 100644 --- a/fuzzers/037-iob18-pips/generate.tcl +++ b/fuzzers/037-iob18-pips/generate.tcl @@ -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"