Updated the tech file with corrected rules for pwell surround
(no overlap distance requirement unless over deep nwell).
Updated the version to go along with the merge of pull request
diff --git a/VERSION b/VERSION
index b98e1c1..ca60195 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0.446
+1.0.447
diff --git a/gf180mcu/magic/gf180mcu.tcl b/gf180mcu/magic/gf180mcu.tcl
index 4632459..532f983 100644
--- a/gf180mcu/magic/gf180mcu.tcl
+++ b/gf180mcu/magic/gf180mcu.tcl
@@ -697,7 +697,7 @@
 	nx 1 ny 1 dummy 0 lmin 0.45 wmin 0.45 \
 	elc 1 erc 1 etc 1 ebc 1 \
 	glc 1 grc 1 gtc 0 gbc 0 doverlap 0 \
-    full_metal 1 \
+	full_metal 1 \
 	compatible {diode_pd2nw_03v3 diode_pd2nw_06v0}}
 }
 
@@ -1027,7 +1027,7 @@
 	    end_type		mvnsd \
 	    end_contact_type	mvnsc \
 	    end_sub_type	nwell \
-        sub_surround    0.16 \
+	    sub_surround	0.16 \
 	    plus_diff_type	mvpsd \
 	    plus_contact_type	mvpsc \
 	    sub_type		pwell \
diff --git a/gf180mcu/magic/gf180mcu.tech b/gf180mcu/magic/gf180mcu.tech
index 8197334..a71ce0c 100644
--- a/gf180mcu/magic/gf180mcu.tech
+++ b/gf180mcu/magic/gf180mcu.tech
@@ -1540,10 +1540,33 @@
  options calma-permissive-labels
  gridlimit 5
 
- # Check that all p-diff and n-ohmic has either nwell or dnwell
+ # Check that all p-diff and n-ohmic have either nwell or dnwell
  templayer missing_nwell *nsd,*mvnsd,*pdiff,*mvpdiff,*pdiode,pdiffres,mvpdiffres,pfet,mvpfet,mvnvaractor
  and-not dnwell,nwell
 
+ # Check that all p-ohmic and n-diff have either pwell + dnwell
+ # or nothing.  Can check the pwell surround at the same time.
+
+ templayer pohmic_missing_pwell *psd
+ grow 120
+ and dnwell
+ and-not pwell
+
+ templayer mvpohmic_missing_pwell *mvpsd,mvpvaractor
+ grow 160
+ and dnwell
+ and-not pwell
+
+ templayer pdiff_missing_pwell *ndiff,*ndiode,ndiffres,nfet
+ grow 430
+ and dnwell
+ and-not pwell
+
+ templayer mvpdiff_missing_pwell *mvndiff,mvndiffres,mvnfet
+ grow 600
+ and dnwell
+ and-not pwell
+
  # Check for MV and LV devices in the same dnwell
  templayer mv_dnwell
  bloat-all alldiffmv,schottky dnwell
@@ -2985,12 +3008,21 @@
 	"Deep N-well overlap of P-Diffusion < %d (DF.4e)"
  # Use CIF-DRC rule to ensure that at least one exists.
  cifmaxwidth missing_nwell 0 bend_illegal \
-	"P-diffusion and M-ohmic must be over N-well or deep N-well (DN.11)"
+	"P-diffusion and N-ohmic must be over N-well or deep N-well"
+ # Use CIF-DRC rules to ensure where pwell must be inside dnwell
+ cifmaxwidth pohmic_missing_pwell 0 bend_illegal \
+	"P-well must surround P-ohmic in deep N-well by 0.12um (DF.5)"
+ cifmaxwidth mvpohmic_missing_pwell 0 bend_illegal \
+	"P-well must surround MV P-ohmic in deep N-well by 0.16um (DF.5)"
+ cifmaxwidth ndiff_missing_pwell 0 bend_illegal \
+	"P-well must surround N-diffusion inside deep N-well by 0.43um (DF.8)"
+ cifmaxwidth mvndiff_missing_pwell 0 bend_illegal \
+	"P-well must surround MV N-diffusion inside deep N-well by 0.60um (DF.8)"
 
- surround *psd pwell 120 absence_ok \
-	"P-field overlap of P-Ohmic < %d (DF.5)"
- surround *mvpsd pwell  160 absence_ok \
-	"MV P-field overlap of MV P-Ohmic < %d (DF.5)"
+# surround *psd pwell 120 absence_ok \
+#	"P-well overlap of P-Ohmic < %d (DF.5)"
+# surround *mvpsd pwell  160 absence_ok \
+#	"MV P-well overlap of MV P-Ohmic < %d (DF.5)"
 
  # NAT requires additional spacing rules
  spacing *nndiode,*mvnndiode *psd,*mvpsd 610 touching_illegal \