From ff993816241e9de0b9b4ef31c4e9e0e29be1aac3 Mon Sep 17 00:00:00 2001 From: Stefan Schippers Date: Wed, 7 Jun 2023 20:41:09 +0200 Subject: [PATCH] add procedure `fix_symbols `to set `n` last directory components to all symbols in current design --- src/xschem.tcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/xschem.tcl b/src/xschem.tcl index 54df0ccc..e542ed99 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -4611,6 +4611,21 @@ proc get_directory {f} { return $r } +# set 'n' last directory components to every symbol +proc fix_symbols {n} { + set fast {} + foreach {i s t} [xschem instance_list] { + set sympath [find_file_first $s] + if { $sympath ne {}} { + set new_sym_ref [get_cell $sympath $n] + puts "$i: $s --> $new_sym_ref" + xschem replace_symbol $i $new_sym_ref $fast + set fast fast + } + } + xschem redraw +} + # fetch a remote url into ${XSCHEM_TMP_DIR}/xschem_web proc download_url {url} { global XSCHEM_TMP_DIR download_url_helper OS