From 2d5c4be6dda274419868b54f38e35a57dd74c067 Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Wed, 18 Mar 2026 12:18:42 -0400 Subject: [PATCH] Added a few lines of code to the toolkit management to work around the issue of a device name in a netlist having different case than the procedures defined for the device in the PDK. The difference in case is transparent to SPICE, so it should also be transparent to the PDK. --- VERSION | 2 +- tcltk/toolkit.tcl | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a57ad58b..3c1ec140 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.624 +8.3.625 diff --git a/tcltk/toolkit.tcl b/tcltk/toolkit.tcl index a377f7e9..e2610dee 100644 --- a/tcltk/toolkit.tcl +++ b/tcltk/toolkit.tcl @@ -362,6 +362,27 @@ proc magic::generate_layout_add {subname subpins complist library} { } } + # Check if devtype has routines by looking for ${devtype}_defaults. + # If not found, do a case-insensitive check against all devices + # before deciding that devtype is a subcircuit and not a device. + # If found by case-insensitive check, then change the device name + # to the one used in the library. + + if {$library != ""} { + set alldevices [namespace eval ::${library} {info procs}] + } else { + set alldevices [namespace eval ::${PDKNAMESPACE} {info procs}] + } + set devdefault [lsearch $alldevices ${devtype}_defaults] + if {$devdefault == -1} { + set devdefault [lsearch -nocase $alldevices ${devtype}_defaults] + if {$devdefault != -1} { + set devprocname [lindex $alldevices $devdefault] + set devproclist [split $devprocname "_"] + set devtype [lindex $devproclist 0] + } + } + # devtype is assumed to be in library. If not, it will attempt to # use 'getcell' on devtype. Note that this code depends on the # PDK setting varible PDKNAMESPACE.