Modified the magic device generator to properly handle the "nf"
parameter on MOSFET devices when converting from a netlist to
layout. Corrected the netgen setup to ignore both "nf" and "mult"
as netlist parameters, as well as other non-critical parameters
that may or may not appear in both the schematic and layout-
extracted netlists.
diff --git a/sky130/magic/sky130.tcl b/sky130/magic/sky130.tcl
index 684aee5..bf66b4f 100644
--- a/sky130/magic/sky130.tcl
+++ b/sky130/magic/sky130.tcl
@@ -3564,17 +3564,28 @@
dict set pdkparams [string tolower $key] $value
}
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
- } else {
- dict set pdkparams [string tolower $key] $value
- }
+ dict set pdkparams [string tolower $key] $value
+ }
+ nf {
+ # Adjustment ot W will be handled below
+ dict set pdkparams [string tolower $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]
+ }
+ }
+
return $pdkparams
}