Corrected the GF device generator for magic to correctly handle
W vs. NF for a MOSFET as read from a netlist using "readspice",
by dividing W by NF to get width per finger of the device.
diff --git a/VERSION b/VERSION
index c9b46ab..266bc23 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0.536
+1.0.537
diff --git a/gf180mcu/magic/gf180mcu.tcl b/gf180mcu/magic/gf180mcu.tcl
index 80035eb..c466abc 100644
--- a/gf180mcu/magic/gf180mcu.tcl
+++ b/gf180mcu/magic/gf180mcu.tcl
@@ -3350,6 +3350,7 @@
proc gf180mcu::mos_convert {parameters} {
set pdkparams [dict create]
+ set nf 1
dict for {key value} $parameters {
switch -nocase $key {
l -
@@ -3362,20 +3363,46 @@
}
m {
# M value in an expression like '1*1' convert to
- # M and NF
- if {[regexp {\'([0-9]+)\*([0-9]+)\'} $value valid m nf]} {
- dict set pdkparams [string tolower $key] $m
- dict set pdkparams nf $nf
+ # NF and M, and do not overlap fingers.
+ if {[regexp {\'([0-9]+)\*([0-9]+)\'} $value valid mx my]} {
+ dict set pdkparams [string tolower $key] $my
} else {
dict set pdkparams [string tolower $key] $value
}
}
+ nf {
+ # Adjustment of W will be handled after parsing
+ dict set pdkparams $key $value
+ }
default {
# Allow unrecognized parameters to be passed unmodified
dict set pdkparams $key $value
}
}
}
+
+ # Magic does not understand "nf" as a parameter, but expands to
+ # "nf" number of devices connected horizontally. The "w" value
+ # must be divided down accordingly, as the "nf" parameter implies
+ # that the total width "w" is divided into "nf" fingers.
+
+ catch {
+ set w [dict get $pdkparams w]
+ set nf [dict get $pdkparams nf]
+ if {$nf > 1} {
+ dict set pdkparams w [expr $w / $nf]
+ }
+ }
+ catch {
+ set nf [expr $nf * $mx]
+ if {$nf > 1} {
+ dict set pdkparams nf $nf
+ }
+ if {$mx > 1} {
+ dict set pdkparams doverlap 0
+ }
+ }
+
return $pdkparams
}