Merge branch 'main' of https://github.com/mabrains/gf180_technology_dev into ic_res_testcases
diff --git a/BCDLite/klayout/lvs/gf180BCDLite.lvs b/BCDLite/klayout/lvs/gf180BCDLite.lvs
index 7937bfe..f94f962 100644
--- a/BCDLite/klayout/lvs/gf180BCDLite.lvs
+++ b/BCDLite/klayout/lvs/gf180BCDLite.lvs
@@ -212,7 +212,7 @@
 #------------- LAYERS DERIVATIONS ---------------
 #================================================
 
-%include rule_decks/layers_definitions.lvs
+# %include rule_decks/layers_definition.lvs
 
 #================================================================
 #------------------------- MAIN RUNSET --------------------------
@@ -230,19 +230,19 @@
 # ------ GENERAL DERIVATIONS ------
 #==================================
 
-%include rule_decks/general_derivations.lvs
+# %include rule_decks/general_derivations.lvs
 
 #================================
 # ------ BJT DERIVATIONS --------
 #================================
 
-%include rule_decks/bjt_derivations.lvs
+# %include rule_decks/bjt_derivations.lvs
 
 #================================================
 #------------ DEVICES CONNECTIVITY --------------
 #================================================
 
-%include rule_decks/devices_connections.lvs
+# %include rule_decks/devices_connections.lvs
 
 #================================================
 #------------- DEVICES EXTRACTION ---------------
@@ -254,7 +254,7 @@
 # ------- BJT EXTRACTION --------
 #================================
 
-%include rule_decks/bjt_extraction.lvs
+# %include rule_decks/bjt_extraction.lvs
 
 #================================================
 #------------- COMPARISON OPTIONS ---------------
diff --git a/BCDLite/klayout/lvs/rule_decks/bjt_derivations.lvs b/BCDLite/klayout/lvs/rule_decks/bjt_derivations.lvs
index 8bf3f8f..c6581c7 100644
--- a/BCDLite/klayout/lvs/rule_decks/bjt_derivations.lvs
+++ b/BCDLite/klayout/lvs/rule_decks/bjt_derivations.lvs
@@ -25,10 +25,17 @@
 # ==============
 logger.info('Starting vnpn layers DERIVATIONS')
 
+bjt_exclude_layers = resistor.or(esd).or(sab).or(dni).or(pwhv).or(fusewindow_d).or(polyfuse)
+                        .or(schottky_diode).or(zener).or(piscap).or(res_mk).or(diode_mk)
+                        .or(v5_xtor).or(nat).or(fhres).or(mos_cap_mk).or(mvsd).or(mvpsd)
+                        .or(elmd_mk).or(elmd2_mk).or(lvs_rf).or(lvs_source).or(mk_35v)
+                        .or(lvs_35v).or(well_diode_mk).or(esd_hbm_mk).or(mos_mk_type1)
+                        .or(swfet_mk).or(mom_mk).or(hvnddd).or(hvpddd).or(hvpolyrs).or(ldmos_xtor)
+
 # vnpn general nodes DERIVATIONS
-vnpn_e = ncomp_mv.interacting(lvs_bjt).and(dnwell)
-vnpn_b = pcomp_mv.and(drc_bjt).and(lvpwell).and(dnwell)
-vnpn_c = ncomp_mv.and(drc_bjt).not(lvs_bjt).and(dnwell)
+vnpn_e = ncomp_mv.interacting(lvs_bjt).and(dnwell).and(dualgate2_d).not(bjt_exclude_layers)
+vnpn_b = pcomp_mv.and(drc_bjt).and(lvpwell).and(dnwell).and(dualgate2_d).not(bjt_exclude_layers)
+vnpn_c = ncomp_mv.and(drc_bjt).not(lvs_bjt).and(dnwell).and(dualgate2_d).not(bjt_exclude_layers)
 
 # npn_05p00x05p00 nodes DERIVATIONS
 npn_05p00x05p00_e = vnpn_e.with_area(24.5.um, 25.5.um).interacting(vnpn_e.edges.with_length(4.8.um, 5.2.um))
@@ -56,9 +63,9 @@
 logger.info('Starting vpnp layers DERIVATIONS')
 
 # vpnp general nodes DERIVATIONS
-vpnp_e = pcomp_mv.and(nwell).interacting(lvs_bjt).not(dnwell)
-vpnp_b = ncomp_mv.and(nwell).and(drc_bjt).not(dnwell)
-vpnp_c = ptap_mv.not(lvs_bjt).and(drc_bjt).not(dnwell)
+vpnp_e = pcomp_mv.and(nwell).interacting(lvs_bjt).not(dnwell).and(dualgate2_d).not(bjt_exclude_layers)
+vpnp_b = ncomp_mv.and(nwell).and(drc_bjt).not(dnwell).and(dualgate2_d).not(bjt_exclude_layers)
+vpnp_c = ptap_mv.not(lvs_bjt).and(drc_bjt).not(dnwell).and(dualgate2_d).not(bjt_exclude_layers)
 
 # pnp_10p00x10p00_06v0 nodes DERIVATIONS
 pnp_10p00x10p00_06v0_e = vpnp_e.with_area(99.5.um, 100.5.um).interacting(vpnp_e.edges.with_length(9.8.um, 10.2.um))
diff --git a/BCDLite/klayout/lvs/rule_decks/bjt_extraction.lvs b/BCDLite/klayout/lvs/rule_decks/bjt_extraction.lvs
index a28bd75..80bd18e 100644
--- a/BCDLite/klayout/lvs/rule_decks/bjt_extraction.lvs
+++ b/BCDLite/klayout/lvs/rule_decks/bjt_extraction.lvs
@@ -25,10 +25,10 @@
 # ====================
 logger.info('Starting vnpn BJT EXTRACTION')
 
-# npn_05p00x05p00 BJT
-ignore_parameter('npn_05p00x05p00', 'AE')
-logger.info('Extracting npn_05p00x05p00 BJT')
-extract_devices(bjt4('npn_05p00x05p00'), { 'C' => npn_05p00x05p00_c.extents,
+# vnpn_5x5 BJT
+ignore_parameter('vnpn_5x5', 'AE')
+logger.info('Extracting vnpn_5x5 BJT')
+extract_devices(bjt4('vnpn_5x5'), { 'C' => npn_05p00x05p00_c.extents,
                                            'B' => npn_05p00x05p00_b.extents,
                                            'E' => npn_05p00x05p00_e,
                                            'S' => sub.extents,
@@ -37,10 +37,10 @@
                                            'tE' => npn_05p00x05p00_e,
                                            'tS' => sub })
 
-# npn_00p54x16p00 BJT
-ignore_parameter('npn_00p54x16p00', 'AE')
-logger.info('Extracting npn_00p54x16p00 BJT')
-extract_devices(bjt4('npn_00p54x16p00'), { 'C' => npn_00p54x16p00_c.extents,
+# vnpn_0p54x16 BJT
+ignore_parameter('vnpn_0p54x16', 'AE')
+logger.info('Extracting vnpn_0p54x16 BJT')
+extract_devices(bjt4('vnpn_0p54x16'), { 'C' => npn_00p54x16p00_c.extents,
                                            'B' => npn_00p54x16p00_b.extents,
                                            'E' => npn_00p54x16p00_e,
                                            'S' => sub.extents,
@@ -49,10 +49,10 @@
                                            'tE' => npn_00p54x16p00_e,
                                            'tS' => sub })
 
-# npn_00p54x08p00 BJT
-ignore_parameter('npn_00p54x08p00', 'AE')
-logger.info('Extracting npn_00p54x08p00 BJT')
-extract_devices(bjt4('npn_00p54x08p00'), { 'C' => npn_00p54x08p00_c.extents,
+# vnpn_0p54x8 BJT
+ignore_parameter('vnpn_0p54x8', 'AE')
+logger.info('Extracting vnpn_0p54x8 BJT')
+extract_devices(bjt4('vnpn_0p54x8'), { 'C' => npn_00p54x08p00_c.extents,
                                            'B' => npn_00p54x08p00_b.extents,
                                            'E' => npn_00p54x08p00_e,
                                            'S' => sub.extents,
@@ -61,10 +61,10 @@
                                            'tE' => npn_00p54x08p00_e,
                                            'tS' => sub })
 
-# npn_00p54x02p00 BJT
-ignore_parameter('npn_00p54x02p00', 'AE')
-logger.info('Extracting npn_00p54x02p00 BJT')
-extract_devices(bjt4('npn_00p54x02p00'), { 'C' => npn_00p54x02p00_c.extents,
+# vnpn_0p54x2 BJT
+ignore_parameter('vnpn_0p54x2', 'AE')
+logger.info('Extracting vnpn_0p54x2 BJT')
+extract_devices(bjt4('vnpn_0p54x2'), { 'C' => npn_00p54x02p00_c.extents,
                                            'B' => npn_00p54x02p00_b.extents,
                                            'E' => npn_00p54x02p00_e,
                                            'S' => sub.extents,
@@ -78,49 +78,49 @@
 # ====================
 logger.info('Starting vpnp BJT EXTRACTION')
 
-# pnp_10p00x10p00_06v0 BJT
-ignore_parameter('pnp_10p00x10p00_06v0', 'AE')
-logger.info('Extracting pnp_10p00x10p00_06v0 BJT')
-extract_devices(bjt3('pnp_10p00x10p00_06v0'), { 'C' => pnp_10p00x10p00_06v0_c.extents,
+# vpnp_6p0_10x10 BJT
+ignore_parameter('vpnp_6p0_10x10', 'AE')
+logger.info('Extracting vpnp_6p0_10x10 BJT')
+extract_devices(bjt3('vpnp_6p0_10x10'), { 'C' => pnp_10p00x10p00_06v0_c.extents,
                                            'B' => pnp_10p00x10p00_06v0_b.extents,
                                            'E' => pnp_10p00x10p00_06v0_e,
                                            'tC' => pnp_10p00x10p00_06v0_c,
                                            'tB' => pnp_10p00x10p00_06v0_b,
                                            'tE' => pnp_10p00x10p00_06v0_e })
 
-# pnp_05p00x05p00_06v0 BJT
-ignore_parameter('pnp_05p00x05p00_06v0', 'AE')
-logger.info('Extracting pnp_05p00x05p00_06v0 BJT')
-extract_devices(bjt3('pnp_05p00x05p00_06v0'), { 'C' => pnp_05p00x05p00_06v0_c.extents,
+# vpnp_6p0_5x5 BJT
+ignore_parameter('vpnp_6p0_5x5', 'AE')
+logger.info('Extracting vpnp_6p0_5x5 BJT')
+extract_devices(bjt3('vpnp_6p0_5x5'), { 'C' => pnp_05p00x05p00_06v0_c.extents,
                                            'B' => pnp_05p00x05p00_06v0_b.extents,
                                            'E' => pnp_05p00x05p00_06v0_e,
                                            'tC' => pnp_05p00x05p00_06v0_c,
                                            'tB' => pnp_05p00x05p00_06v0_b,
                                            'tE' => pnp_05p00x05p00_06v0_e })
 
-# pnp_00p42x20p00_06v0 BJT
-ignore_parameter('pnp_00p42x20p00_06v0', 'AE')
-logger.info('Extracting pnp_00p42x20p00_06v0 BJT')
-extract_devices(bjt3('pnp_00p42x20p00_06v0'), { 'C' => pnp_00p42x20p00_06v0_c.extents,
+# vpnp_6p0_0p42x20 BJT
+ignore_parameter('vpnp_6p0_0p42x20', 'AE')
+logger.info('Extracting vpnp_6p0_0p42x20 BJT')
+extract_devices(bjt3('vpnp_6p0_0p42x20'), { 'C' => pnp_00p42x20p00_06v0_c.extents,
                                            'B' => pnp_00p42x20p00_06v0_b.extents,
                                            'E' => pnp_00p42x20p00_06v0_e,
                                            'tC' => pnp_00p42x20p00_06v0_c,
                                            'tB' => pnp_00p42x20p00_06v0_b,
                                            'tE' => pnp_00p42x20p00_06v0_e })
-# pnp_00p42x10p00_06v0 BJT
-ignore_parameter('pnp_00p42x10p00_06v0', 'AE')
-logger.info('Extracting pnp_00p42x10p00_06v0 BJT')
-extract_devices(bjt3('pnp_00p42x10p00_06v0'), { 'C' => pnp_00p42x10p00_06v0_c.extents,
+# vpnp_6p0_0p42x10 BJT
+ignore_parameter('vpnp_6p0_0p42x10', 'AE')
+logger.info('Extracting vpnp_6p0_0p42x10 BJT')
+extract_devices(bjt3('vpnp_6p0_0p42x10'), { 'C' => pnp_00p42x10p00_06v0_c.extents,
                                            'B' => pnp_00p42x10p00_06v0_b.extents,
                                            'E' => pnp_00p42x10p00_06v0_e,
                                            'tC' => pnp_00p42x10p00_06v0_c,
                                            'tB' => pnp_00p42x10p00_06v0_b,
                                            'tE' => pnp_00p42x10p00_06v0_e })
 
-# pnp_00p42x05p00_06v0 BJT
-ignore_parameter('pnp_00p42x05p00_06v0', 'AE')
-logger.info('Extracting pnp_00p42x05p00_06v0 BJT')
-extract_devices(bjt3('pnp_00p42x05p00_06v0'), { 'C' => pnp_00p42x05p00_06v0_c.extents,
+# vpnp_6p0_0p42x5 BJT
+ignore_parameter('vpnp_6p0_0p42x5', 'AE')
+logger.info('Extracting vpnp_6p0_0p42x5 BJT')
+extract_devices(bjt3('vpnp_6p0_0p42x5'), { 'C' => pnp_00p42x05p00_06v0_c.extents,
                                            'B' => pnp_00p42x05p00_06v0_b.extents,
                                            'E' => pnp_00p42x05p00_06v0_e,
                                            'tC' => pnp_00p42x05p00_06v0_c,
diff --git a/BCDLite/klayout/lvs/rule_decks/custom_classes.lvs b/BCDLite/klayout/lvs/rule_decks/custom_classes.lvs
new file mode 100644
index 0000000..23f3250
--- /dev/null
+++ b/BCDLite/klayout/lvs/rule_decks/custom_classes.lvs
@@ -0,0 +1,160 @@
+################################################################################################
+# Copyright 2022 GlobalFoundries PDK Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+################################################################################################
+
+#================================================
+# --------------- CUSTOM CLASSES ----------------
+#================================================
+
+#=========== CUSTOM READER ===========
+class SubcircuitModelsReader < RBA::NetlistSpiceReaderDelegate
+  def parse_element(sup, element)
+    begin
+      super
+    rescue
+      case element
+      when 'C'
+        super("#{sup} C=2e-16", element)
+      when 'R'
+        super("#{sup} R=0", element)
+      else
+        super
+      end
+    end
+  end
+  
+  # implements the delegate interface:
+  # take and translate the element
+  def element(circuit, ele, name, model, value, nets, params)
+    case ele
+    when 'C'
+      error('Capacitor needs two nodes') if nets.size != 2
+
+      # provide a device class
+      cls = circuit.netlist.device_class_by_name(model)
+      unless cls
+        cls = RBA::DeviceClassCapacitor.new
+        cls.name = model
+        circuit.netlist.add(cls)
+      end
+
+      # create a device
+      device = circuit.create_device(cls, name)
+
+      # and configure the device
+      %w[A B].each_with_index do |t, index|
+        device.connect_terminal(t, nets[index])
+      end
+
+      # parameters in the model are given in micrometer units, so
+      # we need to translate the parameter values from SI to um values:
+      device.set_parameter('A', ((params['W'] || 0.0) * (params['L'] || 0.0)) * 1e12)
+      device.set_parameter('P', ((params['W'] || 0.0) + (params['L'] || 0.0)) * 2e6)
+      device.set_parameter('C', (params['C'] || 0.0))
+
+    when 'R'
+      case nets.size
+      when 3
+        # provide a device class
+        cls = circuit.netlist.device_class_by_name(model)
+        unless cls
+          cls = RBA::DeviceClassResistorWithBulk.new
+          cls.name = model
+          circuit.netlist.add(cls)
+        end
+
+        # create a device
+        device = circuit.create_device(cls, name)
+
+        # and configure the device
+        %w[A B W].each_with_index do |t, index|
+          device.connect_terminal(t, nets[index])
+        end
+
+      when 2
+        # provide a device class
+        cls = circuit.netlist.device_class_by_name(model)
+        unless cls
+          cls = RBA::DeviceClassResistor.new
+          cls.name = model
+          circuit.netlist.add(cls)
+        end
+
+        # create a device
+        device = circuit.create_device(cls, name)
+
+        # and configure the device
+        %w[A B].each_with_index do |t, index|
+          device.connect_terminal(t, nets[index])
+        end
+
+      else
+        error('Resistor needs two or three nodes')
+
+      end
+
+      # parameters in the model are given in micrometer units, so
+      # we need to translate the parameter values from SI to um values:
+      device.set_parameter('W', ((params['W'] || 0.0) * (params['PAR'] || 1.0)) * 1e6)
+      device.set_parameter('L', ((params['L'] || 0.0) * (params['S'] || 1.0)) * 1e6)
+      device.set_parameter('R', (params['R'] * (params['S'] || 1.0) / (params['PAR'] || 1.0)))
+
+    else
+      return super
+
+    end
+    true
+  end
+end
+
+# 4 terminals resistor device extractor
+class BResistor < RBA::DeviceClassResistorWithBulk
+  def initialize
+    super
+    enable_parameter('R', false)
+    enable_parameter('W', true)
+    enable_parameter('L', true)
+  end
+end
+
+# 3 terminals resistor device extractor
+class NResistor < RBA::DeviceClassResistor
+  def initialize
+    super
+    enable_parameter('R', false)
+    enable_parameter('W', true)
+    enable_parameter('L', true)
+  end
+end
+
+# MosCap device extractor
+class MosCap < RBA::DeviceClassCapacitor
+  def initialize
+    super
+    enable_parameter('C', false)
+    enable_parameter('A', true)
+    enable_parameter('P', true)
+  end
+end
+
+# MIMCAP device extractor
+class MIMCap < RBA::DeviceClassCapacitor
+  def initialize
+    super
+    enable_parameter('C', true)
+    enable_parameter('A', true)
+    enable_parameter('P', true)
+  end
+end
diff --git a/BCDLite/klayout/lvs/rule_decks/devices_connections.lvs b/BCDLite/klayout/lvs/rule_decks/devices_connections.lvs
index 7b2ed18..670e2cf 100644
--- a/BCDLite/klayout/lvs/rule_decks/devices_connections.lvs
+++ b/BCDLite/klayout/lvs/rule_decks/devices_connections.lvs
@@ -40,8 +40,8 @@
 connect(psd_dw, contact)
 connect(nsd, contact)
 connect(poly2_con, contact)
-connect(contact, metal1_con)
-connect(metal1_con, via1)
+connect(contact, metal1)
+connect(metal1, via1)
 connect(via1, metal2_ncap)
 if METAL_LEVEL != '2LM'
   connect(metal2_ncap, via2)
@@ -65,7 +65,7 @@
 # Attaching labels
 connect(comp, comp_label)
 connect(poly2_con, poly2_label)
-connect(metal1_con, metal1_label)
+connect(metal1, metal1_label)
 connect(metal2_ncap, metal2_label)
 if METAL_LEVEL != '2LM'
   connect(metal3_ncap, metal3_label)
diff --git a/BCDLite/klayout/lvs/rule_decks/general_derivations.lvs b/BCDLite/klayout/lvs/rule_decks/general_derivations.lvs
index f3c0ba3..0274429 100644
--- a/BCDLite/klayout/lvs/rule_decks/general_derivations.lvs
+++ b/BCDLite/klayout/lvs/rule_decks/general_derivations.lvs
@@ -51,37 +51,3 @@
 nwell_con   = nwell.not(res_mk)
 lvpwell_con = lvpwell.not(res_mk)
 poly2_con   = poly2.not(res_mk).not(plfuse)
-
-metal1_con = metal1.not(metal1_res)
-metal2_con = metal2.not(metal2_res)
-
-metal3_con = metal3.not(metal3_res) if METAL_LEVEL != '2LM'
-
-metaltop_con = metaltop.not(metal6_res) if METAL_LEVEL == '6LM'
-
-#=====================================================
-#------------- BASE LAYERS DERIVATIONS ---------------
-#=====================================================
-
-dnwell_n        = dnwell.not(lvpwell)
-dnwell_p        = dnwell.and(lvpwell)
-
-all_nwell       = dnwell_n.join(nwell)
-ntap            = ncomp.and(all_nwell).not(res_mk)
-ptap            = pcomp.not(all_nwell).not(res_mk)
-
-## DV2_D (Medium Voltage Gate Oxide)
-nom_gate = tgate.not(dualgate2_d)
-thick_gate = tgate.and(dualgate2_d)
-
-ngate_56v = ngate.and(dualgate2_d)
-pgate_56v = pgate.and(dualgate2_d)
-
-ngate_5v = ngate_56v.and(v5_xtor)
-pgate_5v = pgate_56v.and(v5_xtor)
-
-ngate_6v = ngate_56v.not(v5_xtor)
-pgate_6v = pgate_56v.not(v5_xtor)
-
-lvpwell_dn  = lvpwell.interacting(dnwell)
-lvpwell_out = lvpwell.not_interacting(dnwell)
diff --git a/BCDLite/klayout/lvs/rule_decks/layers_definition.lvs b/BCDLite/klayout/lvs/rule_decks/layers_definition.lvs
index 237686a..d18f000 100644
--- a/BCDLite/klayout/lvs/rule_decks/layers_definition.lvs
+++ b/BCDLite/klayout/lvs/rule_decks/layers_definition.lvs
@@ -24,7 +24,7 @@
 logger.info('Read in polygons from layers.')
 
 def get_polygons(layer, data_type)
-  ps = get_polygons(layer, data_type)
+  ps = polygons(layer, data_type)
   $run_mode == 'deep' ? ps : ps.merged
 end
 
@@ -851,3 +851,7 @@
 polygons_count += count
 
 logger.info("Total no. of polygons in the design is #{polygons_count}")
+
+
+#=== BULK LAYER ===
+sub = polygon_layer
\ No newline at end of file
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vnpn_0p54x16.gds b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vnpn_0p54x16.gds
new file mode 100644
index 0000000..4a91319
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vnpn_0p54x16.gds
Binary files differ
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vnpn_0p54x2.gds b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vnpn_0p54x2.gds
new file mode 100644
index 0000000..7b26685
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vnpn_0p54x2.gds
Binary files differ
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vnpn_0p54x8.gds b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vnpn_0p54x8.gds
new file mode 100644
index 0000000..84d711b
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vnpn_0p54x8.gds
Binary files differ
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vnpn_5x5.gds b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vnpn_5x5.gds
new file mode 100644
index 0000000..1ad6cdd
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vnpn_5x5.gds
Binary files differ
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_0p42x10.gds b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_0p42x10.gds
new file mode 100644
index 0000000..f6474e6
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_0p42x10.gds
Binary files differ
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_0p42x20.gds b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_0p42x20.gds
new file mode 100644
index 0000000..692ccc1
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_0p42x20.gds
Binary files differ
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_0p42x5.gds b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_0p42x5.gds
new file mode 100644
index 0000000..b2b60fc
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_0p42x5.gds
Binary files differ
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_10x10.gds b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_10x10.gds
new file mode 100644
index 0000000..83d1ce6
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_10x10.gds
Binary files differ
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_5x5.gds b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_5x5.gds
new file mode 100644
index 0000000..2ea4827
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/layout/vpnp_6p0_5x5.gds
Binary files differ
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vnpn_0p54x16.cdl b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vnpn_0p54x16.cdl
new file mode 100644
index 0000000..35213d6
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vnpn_0p54x16.cdl
@@ -0,0 +1,34 @@
+************************************************************************
+* auCdl Netlist:
+* 
+* Library Name:  TCG_Library
+* Top Cell Name: vnpn_0p54x16
+* View Name:     schematic
+* Netlisted on:  Nov 24 10:25:03 2021
+************************************************************************
+
+*.BIPOLAR
+*.RESI = 2000 
+*.RESVAL
+*.CAPVAL
+*.DIOPERI
+*.DIOAREA
+*.EQUATION
+*.SCALE METER
+*.MEGA
+.PARAM
+
+
+
+************************************************************************
+* Library Name: TCG_Library
+* Cell Name:    vnpn_0p54x16
+* View Name:    schematic
+************************************************************************
+
+.SUBCKT vnpn_0p54x16 I1_default_B I1_default_C I1_default_E I1_default_S
+*.PININFO I1_default_B:I I1_default_C:I I1_default_E:I I1_default_S:I
+QI1_default I1_default_C I1_default_B I1_default_E I1_default_S vnpn_0p54x16 
++ m=1
+.ENDS
+
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vnpn_0p54x2.cdl b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vnpn_0p54x2.cdl
new file mode 100644
index 0000000..a2046bf
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vnpn_0p54x2.cdl
@@ -0,0 +1,33 @@
+************************************************************************
+* auCdl Netlist:
+* 
+* Library Name:  TCG_Library
+* Top Cell Name: vnpn_0p54x2
+* View Name:     schematic
+* Netlisted on:  Nov 24 10:21:29 2021
+************************************************************************
+
+*.BIPOLAR
+*.RESI = 2000 
+*.RESVAL
+*.CAPVAL
+*.DIOPERI
+*.DIOAREA
+*.EQUATION
+*.SCALE METER
+*.MEGA
+.PARAM
+
+
+
+************************************************************************
+* Library Name: TCG_Library
+* Cell Name:    vnpn_0p54x2
+* View Name:    schematic
+************************************************************************
+
+.SUBCKT vnpn_0p54x2 I1_default_B I1_default_C I1_default_E I1_default_S
+*.PININFO I1_default_B:I I1_default_C:I I1_default_E:I I1_default_S:I
+QI1_default I1_default_C I1_default_B I1_default_E I1_default_S vnpn_0p54x2 m=1
+.ENDS
+
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vnpn_0p54x8.cdl b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vnpn_0p54x8.cdl
new file mode 100644
index 0000000..ef185ba
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vnpn_0p54x8.cdl
@@ -0,0 +1,33 @@
+************************************************************************
+* auCdl Netlist:
+* 
+* Library Name:  TCG_Library
+* Top Cell Name: vnpn_0p54x8
+* View Name:     schematic
+* Netlisted on:  Nov 24 10:24:33 2021
+************************************************************************
+
+*.BIPOLAR
+*.RESI = 2000 
+*.RESVAL
+*.CAPVAL
+*.DIOPERI
+*.DIOAREA
+*.EQUATION
+*.SCALE METER
+*.MEGA
+.PARAM
+
+
+
+************************************************************************
+* Library Name: TCG_Library
+* Cell Name:    vnpn_0p54x8
+* View Name:    schematic
+************************************************************************
+
+.SUBCKT vnpn_0p54x8 I1_default_B I1_default_C I1_default_E I1_default_S
+*.PININFO I1_default_B:I I1_default_C:I I1_default_E:I I1_default_S:I
+QI1_default I1_default_C I1_default_B I1_default_E I1_default_S vnpn_0p54x8 m=1
+.ENDS
+
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vnpn_5x5.cdl b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vnpn_5x5.cdl
new file mode 100644
index 0000000..d22f81b
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vnpn_5x5.cdl
@@ -0,0 +1,33 @@
+************************************************************************
+* auCdl Netlist:
+* 
+* Library Name:  TCG_Library
+* Top Cell Name: vnpn_5x5
+* View Name:     schematic
+* Netlisted on:  Nov 24 10:26:06 2021
+************************************************************************
+
+*.BIPOLAR
+*.RESI = 2000 
+*.RESVAL
+*.CAPVAL
+*.DIOPERI
+*.DIOAREA
+*.EQUATION
+*.SCALE METER
+*.MEGA
+.PARAM
+
+
+
+************************************************************************
+* Library Name: TCG_Library
+* Cell Name:    vnpn_5x5
+* View Name:    schematic
+************************************************************************
+
+.SUBCKT vnpn_5x5 I1_default_B I1_default_C I1_default_E I1_default_S
+*.PININFO I1_default_B:I I1_default_C:I I1_default_E:I I1_default_S:I
+QI1_default I1_default_C I1_default_B I1_default_E I1_default_S vnpn_5x5 m=1
+.ENDS
+
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_0p42x10.cdl b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_0p42x10.cdl
new file mode 100644
index 0000000..2b6a54c
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_0p42x10.cdl
@@ -0,0 +1,33 @@
+************************************************************************
+* auCdl Netlist:
+* 
+* Library Name:  TCG_Library
+* Top Cell Name: vpnp_6p0_0p42x10
+* View Name:     schematic
+* Netlisted on:  Nov 24 10:34:45 2021
+************************************************************************
+
+*.BIPOLAR
+*.RESI = 2000 
+*.RESVAL
+*.CAPVAL
+*.DIOPERI
+*.DIOAREA
+*.EQUATION
+*.SCALE METER
+*.MEGA
+.PARAM
+
+
+
+************************************************************************
+* Library Name: TCG_Library
+* Cell Name:    vpnp_6p0_0p42x10
+* View Name:    schematic
+************************************************************************
+
+.SUBCKT vpnp_6p0_0p42x10 I1_default_B I1_default_C I1_default_E
+*.PININFO I1_default_B:I I1_default_C:I I1_default_E:I
+QI1_default I1_default_C I1_default_B I1_default_E vpnp_6p0_0p42x10 m=1
+.ENDS
+
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_0p42x20.cdl b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_0p42x20.cdl
new file mode 100644
index 0000000..c50226a
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_0p42x20.cdl
@@ -0,0 +1,33 @@
+************************************************************************
+* auCdl Netlist:
+* 
+* Library Name:  TCG_Library
+* Top Cell Name: vpnp_6p0_0p42x20
+* View Name:     schematic
+* Netlisted on:  Nov 24 10:34:45 2021
+************************************************************************
+
+*.BIPOLAR
+*.RESI = 2000 
+*.RESVAL
+*.CAPVAL
+*.DIOPERI
+*.DIOAREA
+*.EQUATION
+*.SCALE METER
+*.MEGA
+.PARAM
+
+
+
+************************************************************************
+* Library Name: TCG_Library
+* Cell Name:    vpnp_6p0_0p42x20
+* View Name:    schematic
+************************************************************************
+
+.SUBCKT vpnp_6p0_0p42x20 I1_default_B I1_default_C I1_default_E
+*.PININFO I1_default_B:I I1_default_C:I I1_default_E:I
+QI1_default I1_default_C I1_default_B I1_default_E vpnp_6p0_0p42x20 m=1
+.ENDS
+
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_0p42x5.cdl b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_0p42x5.cdl
new file mode 100644
index 0000000..12736c4
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_0p42x5.cdl
@@ -0,0 +1,33 @@
+************************************************************************
+* auCdl Netlist:
+* 
+* Library Name:  TCG_Library
+* Top Cell Name: vpnp_6p0_0p42x5
+* View Name:     schematic
+* Netlisted on:  Nov 24 10:34:45 2021
+************************************************************************
+
+*.BIPOLAR
+*.RESI = 2000 
+*.RESVAL
+*.CAPVAL
+*.DIOPERI
+*.DIOAREA
+*.EQUATION
+*.SCALE METER
+*.MEGA
+.PARAM
+
+
+
+************************************************************************
+* Library Name: TCG_Library
+* Cell Name:    vpnp_6p0_0p42x5
+* View Name:    schematic
+************************************************************************
+
+.SUBCKT vpnp_6p0_0p42x5 I1_default_B I1_default_C I1_default_E
+*.PININFO I1_default_B:I I1_default_C:I I1_default_E:I
+QI1_default I1_default_C I1_default_B I1_default_E vpnp_6p0_0p42x5 m=1
+.ENDS
+
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_10x10.cdl b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_10x10.cdl
new file mode 100644
index 0000000..5eb6971
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_10x10.cdl
@@ -0,0 +1,33 @@
+************************************************************************
+* auCdl Netlist:
+* 
+* Library Name:  TCG_Library
+* Top Cell Name: vpnp_6p0_10x10
+* View Name:     schematic
+* Netlisted on:  Nov 24 10:34:45 2021
+************************************************************************
+
+*.BIPOLAR
+*.RESI = 2000 
+*.RESVAL
+*.CAPVAL
+*.DIOPERI
+*.DIOAREA
+*.EQUATION
+*.SCALE METER
+*.MEGA
+.PARAM
+
+
+
+************************************************************************
+* Library Name: TCG_Library
+* Cell Name:    vpnp_6p0_10x10
+* View Name:    schematic
+************************************************************************
+
+.SUBCKT vpnp_6p0_10x10 I1_default_B I1_default_C I1_default_E
+*.PININFO I1_default_B:I I1_default_C:I I1_default_E:I
+QI1_default I1_default_C I1_default_B I1_default_E vpnp_6p0_10x10 m=1
+.ENDS
+
diff --git a/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_5x5.cdl b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_5x5.cdl
new file mode 100644
index 0000000..22dcf35
--- /dev/null
+++ b/BCDLite/klayout/lvs/testing/testcases/unit/bjt_devices/netlist/vpnp_6p0_5x5.cdl
@@ -0,0 +1,33 @@
+************************************************************************
+* auCdl Netlist:
+* 
+* Library Name:  TCG_Library
+* Top Cell Name: vpnp_6p0_5x5
+* View Name:     schematic
+* Netlisted on:  Nov 24 10:34:45 2021
+************************************************************************
+
+*.BIPOLAR
+*.RESI = 2000 
+*.RESVAL
+*.CAPVAL
+*.DIOPERI
+*.DIOAREA
+*.EQUATION
+*.SCALE METER
+*.MEGA
+.PARAM
+
+
+
+************************************************************************
+* Library Name: TCG_Library
+* Cell Name:    vpnp_6p0_5x5
+* View Name:    schematic
+************************************************************************
+
+.SUBCKT vpnp_6p0_5x5 I1_default_B I1_default_C I1_default_E
+*.PININFO I1_default_B:I I1_default_C:I I1_default_E:I
+QI1_default I1_default_C I1_default_B I1_default_E vpnp_6p0_5x5 m=1
+.ENDS
+